Skip to content

fix(io): normalize the FixedSizeList type of VECTOR batches - #3

Merged
cursor[bot] merged 1 commit into
codex/vector-parquet-mvpfrom
cursor/normalize-vector-read-type-fcb8
Aug 18, 2026
Merged

fix(io): normalize the FixedSizeList type of VECTOR batches#3
cursor[bot] merged 1 commit into
codex/vector-parquet-mvpfrom
cursor/normalize-vector-read-type-fcb8

Conversation

@ChaomingZhangCN

Copy link
Copy Markdown
Owner

Purpose

Addresses the [P1] Normalize the FixedSizeList output type review comment from @SteNicholas on apache/paimon-cpp#198.

VectorFileBatchReader::ConvertToReadType compared only the list size and the value data type of a file that already stores a VECTOR column as FixedSizeList, then returned the array unchanged. The element field of the file therefore survived into the result: the Rust fixture uses element: float not null while a Paimon schema uses item: float. Files storing VECTOR as LIST are cast to the requested type, so a scan spanning both encodings produced batches of unequal Arrow types and ChunkedArray::Make failed with Array chunks must all be same type.

After validating the values, the reader now rewraps a copy of array->data() with the requested read_type. This is zero-copy: the buffers and child data are shared and only the type is replaced. The value type is already known to be equal at that point, so the rewrap cannot invalidate the array, and ConvertBatch still runs Validate() on the result.

Tests

  • VectorFileBatchReaderTest.NormalizeFixedSizeListElementField: a mock file exposing fixed_size_list<element: float not null>[3] at the top level and nested in a LIST is read with a schema using item: float, and the batch must carry the requested type.
  • ParquetVectorIoTest.ReadMixedListAndFixedSizeListFixtures: reads the Java LIST fixture and the Rust FixedSizeList fixture with one id INT, embedding VECTOR<FLOAT, 3> schema, asserts both batch types equal the logical type, and combines the chunks of both files into a single ChunkedArray.

API and Format

No. The change only affects the Arrow type reported for VECTOR batches, which now always matches the requested read schema.

Documentation

No.

Generative AI tooling

Generated-by: Cursor (Claude Opus 5)

Open in Web Open in Cursor 

A file storing a VECTOR column as FixedSizeList was returned with the
element field of the file, while a file storing it as LIST was cast to
the element field of the read schema. Reading both encodings with one
table schema therefore produced batches of unequal Arrow types, which
cannot be combined into a single result.

Rewrap the validated values in the requested type instead of returning
the file type unchanged.
@cursor
cursor Bot merged commit 5d93d88 into codex/vector-parquet-mvp Aug 18, 2026
@cursor
cursor Bot deleted the cursor/normalize-vector-read-type-fcb8 branch August 18, 2026 11:43
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.

2 participants