Repository navigation
fix: [branch-1.2] split a coalesced broadcast before a string or binary vector passes 1 GiB (#7193) - #7646
Merged
Conversation
…ses 1 GiB (apache#7193) coalesceBroadcastBatches appended the whole broadcast into one VectorSchemaRoot. Arrow Java's VectorAppender grows a string or binary data buffer by doubling it and cannot go past 1 GiB, so a broadcast join failed with OversizedAllocationException once one such column of the build side held more than that (apache#7192). Start a new coalesced batch when the next input batch would take a string or binary vector, nested ones included, past 2^30 bytes of values. A broadcast below that is still one batch. An OversizedAllocationException from the appender now leaves the broadcast uncoalesced, as an IllegalArgumentException already does. (cherry picked from commit 4e54f1c)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Backport of #7193 to
branch-1.2. Closes #7192 on this branch.Rationale for this change
coalesceBroadcastBatchesappends the whole broadcast into oneVectorSchemaRoot. Arrow Java'sVectorAppendergrows a string or binary data buffer by doubling it and cannot go past 1 GiB, so a broadcast join fails withOversizedAllocationExceptiononce one such column of the build side holds more than that, where Spark runs the same query.branch-1.2has the same unbounded coalescing inUtils.coalesceBroadcastBatches. See #7193 and #7192 for the full analysis and repro.What changes are included in this PR?
Cherry-pick of 4e54f1c (
git cherry-pick -x) with no conflicts and no adaptations.coalesceBroadcastBatchesstarts a new coalesced batch when the next input batch would take a string or binary vector (nested ones included) past 2^30 bytes of values, and anOversizedAllocationExceptionfrom the appender now leaves the broadcast uncoalesced. A broadcast below that size is still one batch. It includes the source PR'sUtilsSuitetest.Other release branches:
branch-1.2is the newest release branch, so there is no newer one to port to. Whetherbranch-1.1needs a backport is not part of this PR.How are these changes tested?
On this branch, with JDK 17 and the default Spark profile (4.1):
./mvnw test-compilepasses, andUtilsSuitepasses (15 tests, 0 failures) including the new test. I did not rerun the 1 GiB repro from #7192. The test cannot fail onbranch-1.2without the fix in the usual way, because it passes the newmaxValueBytesparameter, so withspark/src/mainreverted tobranch-1.2's version the test does not compile. I ran the default Spark profile only.