fix(io): normalize the FixedSizeList type of VECTOR batches - #3
Merged
cursor[bot] merged 1 commit intoAug 18, 2026
Merged
Conversation
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.
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
Addresses the
[P1] Normalize the FixedSizeList output typereview comment from @SteNicholas on apache/paimon-cpp#198.VectorFileBatchReader::ConvertToReadTypecompared only the list size and the value data type of a file that already stores a VECTOR column asFixedSizeList, then returned the array unchanged. The element field of the file therefore survived into the result: the Rust fixture useselement: float not nullwhile a Paimon schema usesitem: float. Files storing VECTOR asLISTare cast to the requested type, so a scan spanning both encodings produced batches of unequal Arrow types andChunkedArray::Makefailed withArray chunks must all be same type.After validating the values, the reader now rewraps a copy of
array->data()with the requestedread_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, andConvertBatchstill runsValidate()on the result.Tests
VectorFileBatchReaderTest.NormalizeFixedSizeListElementField: a mock file exposingfixed_size_list<element: float not null>[3]at the top level and nested in aLISTis read with a schema usingitem: float, and the batch must carry the requested type.ParquetVectorIoTest.ReadMixedListAndFixedSizeListFixtures: reads the JavaLISTfixture and the RustFixedSizeListfixture with oneid INT, embedding VECTOR<FLOAT, 3>schema, asserts both batch types equal the logical type, and combines the chunks of both files into a singleChunkedArray.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)