-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
[SPARK-14007] [SQL] Manage the memory used by hash map in shuffled hash join #11826
Conversation
Test build #53546 has finished for PR 11826 at commit
|
Test build #53547 has finished for PR 11826 at commit
|
Test build #2652 has finished for PR 11826 at commit
|
cc @rxin |
cc @sameeragarwal for review |
val copiedIter = iter.map { row => | ||
// It's hard to guess what's exactly memory will be used, we have a raft guess here. | ||
// TODO: use BytesToBytesMap instead of HashMap for memory efficiency | ||
val needed = 150 + row.getSizeInBytes |
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.
Can you please explain (and possibly comment in code) the reason behind choosing 150?
LGTM, just one clarifying question. |
Merging this into master. |
Test build #53695 has finished for PR 11826 at commit
|
val got = memoryManager.acquireExecutionMemory( | ||
Math.max(memoryManager.pageSizeBytes(), needed), MemoryMode.ON_HEAP, null) | ||
if (got < needed) { | ||
throw new SparkException("Can't acquire enough memory to build hash map in shuffled" + |
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.
nit: missing space between shuffled and hash
…sh join ## What changes were proposed in this pull request? This PR try acquire the memory for hash map in shuffled hash join, fail the task if there is no enough memory (otherwise it could OOM the executor). It also removed unused HashedRelation. ## How was this patch tested? Existing unit tests. Manual tests with TPCDS Q78. Author: Davies Liu <[email protected]> Closes apache#11826 from davies/cleanup_hash2.
What changes were proposed in this pull request?
This PR try acquire the memory for hash map in shuffled hash join, fail the task if there is no enough memory (otherwise it could OOM the executor).
It also removed unused HashedRelation.
How was this patch tested?
Existing unit tests. Manual tests with TPCDS Q78.