Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Yury-Fridlyand opened this issue Jan 27, 2023 · 2 comments
Open
Labels
bug Something isn't working

Comments

@Yury-Fridlyand
Copy link
Collaborator

Yury-Fridlyand commented Jan 27, 2023

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

@Yury-Fridlyand
Copy link
Collaborator Author

Some technical details. On response serialization

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants