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

SQL: Suggesting a different approach to error messages #31860

Closed
astefan opened this issue Jul 6, 2018 · 2 comments
Closed

SQL: Suggesting a different approach to error messages #31860

astefan opened this issue Jul 6, 2018 · 2 comments
Labels
:Analytics/SQL SQL querying

Comments

@astefan
Copy link
Contributor

astefan commented Jul 6, 2018

At the moment, a limitation in the functionality of ES SQL due to how Elasticserach is able to support such functionality, is presented to the user as an error message that says "Cannot ......, expected....." which loosely implies that the query is maybe wrong (which, in this case, is not wrong from SQL world point-of-view).

Example: SELECT SPACE("languages") s, COUNT(*) count FROM "test_emp" WHERE "languages" IS NOT NULL GROUP BY SPACE("languages") ORDER BY COUNT(*);

This one prints the following error message:

Bad request [Found 1 problem(s)
line 1:178: Cannot order by non-grouped column [COUNT(1)], expected [SPACE(languages)]]

But, ordering by count is not possible because the composite aggregation used behind the scene cannot sort by the size of the buckets (which is the count itself from sql). Maybe the error message could be clearer about this, mentioning somehow that this thing is unsupported: Ordering by non-grouped columns [COUNT(1)] is unsupported, expected [SPACE()]. This makes it less confusing by stating that this specific query configuration is un-supported (which is in fact true).

@astefan astefan added the :Analytics/SQL SQL querying label Jul 6, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search-aggs

@matriv
Copy link
Contributor

matriv commented May 9, 2019

Closing this as the functionality was implemented with #38042 and there is no error thrown since.

@matriv matriv closed this as completed May 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/SQL SQL querying
Projects
None yet
Development

No branches or pull requests

3 participants