Repository navigation
Conversation
Throw when a field node declares a length other than the record batch row count instead of backfilling the column with nulls. AI assistance: Cognition Devin CLI agent (SWE-2 High).
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.
Closes #557.
The IPC reader never compared the length of a field node with the row count of its RecordBatch. A column that declared fewer rows than the batch read with no error:
ensureSameLengthData()made the field nullable and backfilled the missing rows with nulls the writer never wrote, so a reader cannot tell them from real nulls. Arrow C++ refuses such a column inRecordBatch::Validate()._loadRecordBatch()now throws when a loaded column's length differs fromheader.length, before theRecordBatchconstructor can backfill. This applies to both the stream and file readers, and to compressed batches (the node list is unchanged by decompression). Dictionary batches and top-level batch structure are untouched; nested child vectors may still differ in length from the batch, as the format allows.The regression tests patch one field-node length inside otherwise valid streams and files written by the real writers — a column declaring 2 or 0 rows in a 4-row batch now raises an error naming the column, while the unmodified bytes still read correctly. The open PR #551 validates buffer regions and does not cover this fault: the buffers of these streams are unchanged.
All 2,688 IPC tests across 19 suites passed on
main(7a34e681), along with the ESNext ESM source typecheck and ESLint on both changed files. A full local Jest run was not attempted; on the same machine the suite previously reached its 640 MiB Node heap limit. Upstream CI workflows await maintainer approval and have not run.Cognition Devin CLI agent (SWE-2 High) assisted with the implementation, tests, and verification.