[common] Support VECTOR elements in InternalArray accessors - #9773
Merged
JingsongLi merged 5 commits intoSep 14, 2026
Conversation
ARRAY<VECTOR> is accepted by schema validation and readable via ColumnarArray, but the binary data path rejected it in three places: InternalArray.createElementGetter had no VECTOR case (so InternalArraySerializer, which builds its element getter eagerly, failed construction with "type VECTOR not support"), BinaryArray.calculateFixLengthPartSize threw on VECTOR, and BinaryArray.getVector was an unconditional throw — so a row type with an ARRAY<VECTOR> column, e.g. serialized by a primary-key table's local merge, failed no matter how far it got. Route VECTOR through the existing accessors: getVector in the element getter, the 8-byte variable-length slot in calculateFixLengthPartSize (mirroring ARRAY), readVectorData in BinaryArray.getVector (mirroring BinaryRow), and InternalVector in InternalRow.getDataClass for copies. Assisted-by: GLM-5.3
LuciferYang
marked this pull request as draft
September 13, 2026 03:07
The round-trip test copies BinaryArray bytes and never reaches InternalRow.getDataClass, so the VECTOR case that copy() of a GenericArray depends on was unpinned. This copy test throws "Illegal type: VECTOR" on the base and passes on the fix. Co-Authored-By: Claude Code <noreply@anthropic.com>
Three of the five tests pinned the same createElementGetter arm and died together; the one test that touched the binary form used a single non-null element, so the 8-byte variable-length slot, the null bit, toObjectArray and copy-on-binary were pinned by nothing. Fold that coverage into the round trip with a three-element array containing a null, and drop the two tests that only restated the arm elementGetterReadsVector already covers. Co-Authored-By: Claude Code <noreply@anthropic.com>
LuciferYang
marked this pull request as ready for review
September 13, 2026 18:23
JingsongLi
reviewed
Sep 14, 2026
JingsongLi
left a comment
Contributor
There was a problem hiding this comment.
Reviewed 1bf4e78. Requirement fit: SUPPORTED. Implementation: CLEAN.
ARRAY can already be represented in the schema and written through the existing vector serializer, but constructing/copying its binary array failed at the missing accessors. The new cases use the existing variable-length slot and vector reader, consistently with BinaryRow, without introducing a new storage layout.
All three focused tests passed with the changed classes on JDK 8: getter access, serialization/deserialization with a null and multiple vectors, and GenericArray copying. Current CI is successful. No blocking issue found.
Contributor
Author
|
Thank you @JingsongLi |
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.
Purpose
close #9772
ARRAY<VECTOR(n)>is accepted by schema validation and readable viaColumnarArray, but the binary data path rejected it in four places:InternalArray.createElementGetter(no VECTOR case —InternalArraySerializerfailed construction),BinaryArray.calculateFixLengthPartSize(threw),BinaryArray.getVector(unconditional throw), andInternalRow.getDataClass(brokecopy).This PR routes VECTOR through the existing accessors:
getVectorin the element getter, the 8-byte variable-length slot incalculateFixLengthPartSize(mirroring ARRAY),readVectorDatainBinaryArray.getVector(mirroringBinaryRow.getVector), andInternalVectoringetDataClass. The write side (BinaryWriter.writeVector+InternalVectorSerializer) already existed.Tests
New
InternalArrayVectorGetterTest: serializer construction over VECTOR, element getter read, null element through the nullable wrapper, and a full serialize→deserialize→getVector round-trip. RED verified on master (construction threwtype VECTOR not support).API and Format
No format change: vectors in binary rows/arrays use the existing var-length offset-and-size layout written by
writeVectorToVarLenPart; this PR adds the missing read/validate paths.Documentation
None.