Skip to content

[common] Read VECTOR fields from NestedRow - #9864

Open
thswlsqls wants to merge 1 commit into
apache:masterfrom
thswlsqls:fix/common-nestedrow-vector-getter
Open

thswlsqls wants to merge 1 commit into
apache:masterfrom
thswlsqls:fix/common-nestedrow-vector-getter

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Purpose

fix #9861

  • NestedRow.getVector still threw IllegalArgumentException("Unsupported type: VectorType"), so a primary-key table with a ROW<..., VECTOR> column failed at flush: the write buffer holds BinaryRow, and the Parquet/Avro writer reads the nested row via BinaryRow.getRow()NestedRow.getVector().
  • Implement it with MemorySegmentUtils.readVectorData, mirroring BinaryRow.getVector and BinaryArray.getVector; BinaryWriter.writeVector already writes the nested slot, so the layout is unchanged.
  • Lineage: add vector type definition and basic APIs / Implements #7204 added the stub to BinaryArray and NestedRow; [common] Support VECTOR elements in InternalArray accessors #9773 fixed BinaryArray; this fixes the last one.

Tests

  • Added NestedRowTest#testNestedRowWithVector: round-trip of ROW<INT, ROW<INT, VECTOR(3, FLOAT)>>, null vector field, InternalRow.createFieldGetter(VECTOR), and the multi-segment case. Fails with the stub exception without the fix.
  • mvn -pl paimon-common clean install (JDK 11): BUILD SUCCESS, 0 failures (checkstyle, spotless, enforcer included); NestedRowTest 4/4.

NestedRow.getVector still threw the "Unsupported type: VectorType" stub
left by apache#7204, so a primary-key table with a ROW<..., VECTOR> column failed
at flush when the format writer read the nested row. Mirror
BinaryRow.getVector / BinaryArray.getVector (apache#9773) with
MemorySegmentUtils.readVectorData.

Generated-by: Claude Code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] NestedRow.getVector still throws "Unsupported type: VectorType" for nested VECTOR columns

1 participant