[common] Support VECTOR elements in InternalArray accessors - #9773
Open
LuciferYang wants to merge 5 commits into
Open
[common] Support VECTOR elements in InternalArray accessors#9773LuciferYang wants to merge 5 commits into
LuciferYang wants to merge 5 commits into
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
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.