This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 186
order by is not working as expected when more than one group by is used #674
Comments
Thanks for reporting the issue. Could you provide some test data for debuging? Have you try to explain the query by using the explain API. It will help to know what is DSL of this SQL. |
It seems both Term Aggregation and Composite Aggregation API can only support sort inside bucket. One workaround is to adjust the aggregation order based on order by clause:
|
dai-chen
added a commit
to dai-chen/sql
that referenced
this issue
Oct 15, 2020
dai-chen
added a commit
that referenced
this issue
Oct 20, 2020
* Change grammar and ast builder to support order by * Add UT for order by function * Pass jacoco for sql * Fix order by function issue * Improve test framework to support order by comparison * Add more comparison tests * Add test for issue #123 * Add test for issue #674 * Avoid sort again when explain diff for order by query * Replace aggregator in order by clause * Skip date_format test * Add doctest * Fix doctest format * Address PR comments
The issue has been fixed in new query engine (which is for now experimental and disabled by default). You can enable it to preview by changing the plugin setting: https://github.com/opendistro-for-elasticsearch/sql/blob/master/docs/user/admin/settings.rst#opendistro-sql-engine-new-enabled. Thanks! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
{"query": "select id, sum(marks) marks from mark_tables group by id order by marks desc"}
This is working as expected! But when we give more than one column in group by is not working fine!{"query": "select id, name, sum(marks) marks from mark_tables group by id, name order by marks desc"}
. Please, give me some suggestions on this. Is there any workaround for this?The text was updated successfully, but these errors were encountered: