-
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-28488: Merge multiple adjacent union distinct into single adjacent union distinct #5423
base: master
Are you sure you want to change the base?
Conversation
Object... nodeOutputs) throws SemanticException { | ||
UnionMergeContext context = (UnionMergeContext) procCtx; | ||
Collection<Operator> allOps = context.pCtx.getAllOps(); | ||
for (int i = 1; i <= 8; i ++) { |
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.
could we please add some comments around this magic
indices
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.
Added some comments to explain the meaning of indices and logic around them.
Quality Gate passedIssues Measures |
What changes were proposed in this pull request?
This PR proposed a new optimization to reduce the shuffle when computing union distinct of multiple tables. The new optimization merges GroupBy operators computing distinct after Union, thus reducing the number of edges involved by UNION DISTINCT.
A new configuration key,
hive.optimize.merge.adjacent.union.distinct
, is introduced to configure this optimization.Please check out the attached slides in the JIRA page (HIVE-28488) for further explanations.
Why are the changes needed?
To improve execution time of query containing many
UNION DISTINCT
.Does this PR introduce any user-facing change?
No
Is the change a dependency upgrade?
No
How was this patch tested?
The proposed optimization is tested by running TPC-DS query 49 and 75. This PR contains a qfile test to confirm that the patch optimizes query plan.