Skip to content

[BUG] SQL and PPL responses different types for the same things #1296

Closed as not planned

Description

@Yury-Fridlyand

What is the bug?

PPL returns string data type for all string columns.
SQL returns text for text data and keyword for all rest.

text and keyword are not the same thing and a user should be able to distinguish them.

How can one reproduce the bug?

Use sample data from integration tests, for example bank index.
Check mapping for gender and for city:


And then compare types reported by
PPL

$ curl -s -XPOST http://localhost:9200/_plugins/_ppl -H 'Content-Type: application/json' -d '{"query": "source=bank | fields gender, city"}' | grep '"type"'
      "type": "string"
      "type": "string"

SQL

$ curl -s -XPOST http://localhost:9200/_plugins/_sql -H 'Content-Type: application/json' -d '{"query": "select gender, city from bank"}' | grep '"type"'
      "type": "text"
      "type": "keyword"

What is the expected behavior?

Returned type should be same for PPL and SQL. It should match index mapping for all columns given in index.

What is your host/environment?

2.x @ 662a938

Do you have any additional context?

Related to #1038 and to opensearch-project/observability#1392

Activity

  1. added
    bug
    on Jan 27, 2023
  2. Yury-Fridlyand commented on Jan 27, 2023

    @Yury-Fridlyand
    CollaboratorAuthor

    Some technical details. On response serialization

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions