-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
HIVE-27484: Limit pushdown with offset generate wrong results #4471
Conversation
7d8cf36
to
544ada1
Compare
609a975
to
22c1c4c
Compare
@@ -1339,6 +1341,7 @@ limit 1 offset 1 | |||
POSTHOOK: type: QUERY | |||
POSTHOOK: Input: default@src | |||
#### A masked pattern was here #### | |||
86 val_86 86 val_86 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The result was originally empty because it pushes LIMIT 1 OFFSET 1
twice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and this is an important fix for Hive 4.0! Nice job!
@zabetak @kasakrisz Could you please check this change? |
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveSortJoinReduceRule.java
Show resolved
Hide resolved
@zabetak @kasakrisz Could you please take a look when you have a chance? Thanks in advance! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, left minor comments
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveSortJoinReduceRule.java
Show resolved
Hide resolved
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveSortJoinReduceRule.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 pending tests
Kudos, SonarCloud Quality Gate passed! |
Thanks for your reviews 👍 |
What changes were proposed in this pull request?
Fix an incorrect push-down of LIMIT + OFFSET.
https://issues.apache.org/jira/browse/HIVE-27484
I know SemanticAnalyzer also doesn't handle LIMIT + OFFSET correctly when LIMIT + OFFSET is pushed down to parallel tasks. I will be working on it in HIVE-27480 after HIVE-27484.
Why are the changes needed?
To prevent wrong results.
Does this PR introduce any user-facing change?
Bug fix.
Is the change a dependency upgrade?
No
How was this patch tested?
Unit tests