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: Verify GROUP BY ordering on grouped columns #30585

Merged
merged 3 commits into from May 15, 2018

Conversation

Projects
None yet
6 participants
@costin
Copy link
Member

commented May 14, 2018

Due to the way composite aggregation works, ordering in GROUP BY can be
applied only through grouped columns which now the analyzer verifier
enforces.

Fix #29900

SQL: Verify GROUP BY ordering on grouped columns
Due to the way composite aggregation works, ordering in GROUP BY can be
applied only through grouped columns which now the analyzer verifier
enforces.

Fix 29900
@elasticmachine

This comment has been minimized.

Copy link
Collaborator

commented May 14, 2018

Pinging @elastic/es-search-aggs

@costin costin requested review from nik9000 and astefan May 14, 2018

@costin costin force-pushed the costin:fix-for-29900 branch to 19bc9f9 May 15, 2018

@costin costin merged commit 09329eb into elastic:master May 15, 2018

3 checks passed

CLA Commit author is a member of Elasticsearch
Details
elasticsearch-ci Build finished.
Details
elasticsearch-ci/packaging-sample Build finished.
Details

costin added a commit that referenced this pull request May 15, 2018

SQL: Verify GROUP BY ordering on grouped columns (#30585)
Due to the way composite aggregation works, ordering in GROUP BY can be
applied only through grouped columns which now the analyzer verifier
enforces.

Fix 29900

costin added a commit to costin/elasticsearch that referenced this pull request May 15, 2018

SQL: Verify GROUP BY ordering on grouped columns (elastic#30585)
Due to the way composite aggregation works, ordering in GROUP BY can be
applied only through grouped columns which now the analyzer verifier
enforces.

Fix 29900

@costin costin deleted the costin:fix-for-29900 branch May 15, 2018

@bleskes bleskes added v6.3.0 and removed v6.3.1 labels May 16, 2018

@lukasolson

This comment has been minimized.

Copy link
Member

commented Aug 10, 2018

Ran into this today, and tried this as a workaround:

SELECT *
FROM (
  SELECT app.name, SUM(duration) AS total_duration
  FROM qbserve
  WHERE category.productivity = 1
  GROUP BY app.name
)
ORDER BY total_duration DESC

Didn't get an error, but the results also weren't sorted. 🤷‍♂️ Does this mean this is still an issue?

@colings86 colings86 added v7.0.0-beta1 and removed v7.0.0 labels Feb 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.