Repository navigation
Conversation
Arrow Java 19 no longer closes the source ArrowArray struct once ArrayImporter moves it into its own copy (apacheGH-765), so ArrowImporter now closes it itself. Without that, every imported column leaked its ArrowArray struct in CometArrowImportAllocator. BitVectorHelper.getValidityBufferSize is replaced by getValidityBufferSizeFromCount, and setValueCount(0) now allocates an offset buffer on large variable-width vectors, so the empty-vector test uses an unallocated vector instead.
andygrove
marked this pull request as draft
October 28, 2026 20:02
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?
No tracking issue. This is a dependency upgrade.
Rationale for this change
Comet pins arrow-java at 18.3.0. 19.0.0 is the latest release and the version Spark 4.2.0 ships. Comet shades Arrow, so it does not have to match Spark's version, but staying current keeps us on the upstream serialization and C Data fixes (for example GH-343, offset buffers for empty and nested arrays in IPC streams, which the Python UDF runner writes).
The upgrade is not just a version change. Arrow Java 19 changes two behaviors that Comet depended on.
What changes are included in this PR?
pom.xml:arrow.version18.3.0 to 19.0.0.ArrowImporter: Arrow Java 19 no longer closes the sourceArrowArraystruct afterArrayImporter.importArraymoves its contents into the importer's copy (fix: Unsupported types for SinglePartition should fallback to Spark #765).ArrowImporterrelied on that, so every imported column would leak itsArrowArraystruct (128 bytes) inCometArrowImportAllocatorper batch. It now closes the source itself, guarded byisClosed(). The error path comment is updated to match.Utils.scala,UtilsSuite.scala:BitVectorHelper.getValidityBufferSizeis replaced bygetValidityBufferSizeFromCount. The two names never exist in the same release, so this cannot compile against 18.3.UtilsSuite:setValueCount(0)on a large variable-width vector now allocates an 8-byte offset buffer. The empty-vector test needs a vector with no offset buffer, so it uses an unallocated one.apache/arrow-java#88 (C Data import ignores
ArrowArray.offset) is still open in 19.0.0, so the workarounds inffi.mdstay.How are these changes tested?
On the default Spark 4.1 profile, 18 suites that exercise Arrow ran: the Arrow writers and streams,
NativeUtil,UtilsSuite,CometBroadcastValueSuite, native shuffle, the in-memory cache, Parquet read, the UDF bridge, codegen dispatch, the Python runner and the Arrow Python UDF suites. Result: 440 passed, 0 failed, 9 canceled. Without theArrowImporterchange,NativeUtilSuite(4 tests) andCometBroadcastValueSuite(1 test) fail with leaked allocator memory, and the empty-vectorUtilsSuitetest fails without its edit. The same three suites pass on 18.3.0 before the upgrade.I also built the shaded jar and checked it: only
org/apache/arrow/c/**stays unshaded, as configured, and the compression service file is relocated.Not covered by this local run, so CI should decide:
python-udffeature. The PyArrow end-to-end path was not run.