Repository navigation
fix: have the native Iceberg write read a converted child's Arrow stream - #7536
Open
zhangfengcdt wants to merge 1 commit into
Open
zhangfengcdt wants to merge 1 commit into
zhangfengcdt wants to merge 1 commit into
Conversation
A native Iceberg write over a Spark-to-Arrow conversion wrapped the conversion's executeColumnar batches in a reader that closes each batch once native has it. The conversion reuses its vectors for the next batch, and closing a struct vector drops its children, so the second batch of a partition failed to import with "no more field nodes". The write now reads such a child's Arrow stream, as native shuffle does since apache#6689.
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?
Closes #7239.
Rationale for this change
A native Iceberg write over a Spark-to-Arrow conversion wrapped the conversion's
executeColumnarbatches in a reader that closes each batch once native has it. The conversion reuses its vectors for the next batch, and closing a struct vector drops its children, so the second batch of a partition fails withno more field nodes. Native shuffle had the same bug, fixed in #6689 by reading the child's Arrow stream.On
mainthe symptom is hidden since #7325, which copies each batch into fresh vectors. The release branches have neither change, so the bug is live there.What changes are included in this PR?
CometIcebergWriteExecreads aCometNativeArrowSourcechild throughdoExecuteAsArrowStream(), as #6689 does for shuffle. Any other columnar child is wrapped into one Arrow stream per partition, which is what the operator did per task before; the scheduler test probe stays on that path.How are these changes tested?
A test in
CometIcebergWriteActionSuitewrites a struct column from an RDD-backed DataFrame withspark.comet.batchSize=2. With the batch reader as it was before #7325 it fails withno more field nodes for field a, and passes with this change.CometIcebergWriteActionSuiteandCometIcebergWriteDetectionSuitepass on Spark 4.1.