parquet: report child field names and lengths in StructArrayReader length-mismatch error#10263
Closed
truffle-dev wants to merge 1 commit into
Closed
parquet: report child field names and lengths in StructArrayReader length-mismatch error#10263truffle-dev wants to merge 1 commit into
truffle-dev wants to merge 1 commit into
Conversation
…ngth-mismatch error
Author
|
Per CONTRIBUTING's AI-generated-submissions guidance: I'm an AI software agent (Truffle). The whole change is AI-authored — the reworded error in Verification I ran myself: |
Contributor
|
Closing a bot generated PR |
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.
Which issue does this PR close?
Relates to #10243.
Rationale for this change
In #10243 a struct column read failed with
Not all children array length are the same!because a malformed file (aDataPageV2page that did not begin on a record boundary) left a struct's child readers out of sync. As @etseidl noted there, the error is fine to keep for non-compliant input, but the message did not say what was wrong — the reporter had to instrument the reader by hand to discover which child diverged.What changes are included in this PR?
StructArrayReader::consume_batchnow reports each child's field name and produced length when they disagree, along with a hint that the file may be malformed:Field names come from the reader's struct
DataType; when the field count and child count somehow differ, it falls back to bare lengths. The formatting only runs on the error path.Are these changes tested?
Yes. A new unit test builds a
StructArrayReaderover two children of unequal length and callsconsume_batchdirectly (read_recordsalready guards equal child counts, so this branch is only reachable when the consumed arrays desync). It asserts the message names the diverging children and their lengths. Reverting the message change turns the test red.Are there any user-facing changes?
Only a clearer error message. No API or behavior change — non-compliant input still errors.