[BugFix] Fix SQL window functions with ORDER BY/LIMIT on unified query path#5592
[BugFix] Fix SQL window functions with ORDER BY/LIMIT on unified query path#5592dai-chen wants to merge 1 commit into
ORDER BY/LIMIT on unified query path#5592Conversation
PR Reviewer Guide 🔍(Review updated until commit 53958e8)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 53958e8
Previous suggestionsSuggestions up to commit 70ff9d8
|
Scope the fix to the unified query API parser (ExtendedAstBuilder); fixing the shared AstBuilder directly would break the V2/legacy engine. Signed-off-by: Chen Dai <daichen@amazon.com>
70ff9d8 to
53958e8
Compare
|
Persistent review updated to latest commit 53958e8 |
Description
This PR fixes SQL window functions used with
ORDER BY/LIMIT, which produced wrong plans for Analytics Engine). Because fixing the sharedAstBuilderdirectly would impact the SQL V2 engine (V2 requires the top operator to be aProject), the fix is implemented in the extended AST builder of the unified query API only.Case 1 — window over GROUP BY + bare LIMIT
Case 2 — ORDER BY on the window alias
Related Issues
Part of #5248
Check List
--signoffor-s.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.