-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-24076][SQL] Use different seed in HashAggregate to avoid hash conflict #21149
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -755,7 +755,10 @@ case class HashAggregateExec( | |
| } | ||
|
|
||
| // generate hash code for key | ||
| val hashExpr = Murmur3Hash(groupingExpressions, 42) | ||
| // SPARK-24076: HashAggregate uses the same hash algorithm on the same expressions | ||
| // as ShuffleExchange, it may lead to bad hash conflict when shuffle.partitions=8192*n, | ||
| // pick a different seed to avoid this conflict | ||
| val hashExpr = Murmur3Hash(groupingExpressions, 48) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we just use
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @cloud-fan you mean
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes please, thanks! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @cloud-fan would this perform slower since now we are moving to interpreted version for hashcode generation? If not then why didn't we use
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it should be faster, as |
||
| val hashEval = BindReferences.bindReference(hashExpr, child.output).genCode(ctx) | ||
|
|
||
| val (checkFallbackForGeneratedHashMap, checkFallbackForBytesToBytesMap, resetCounter, | ||
|
|
||
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.
How about writing comments for the reason why we set the seed value here?