Repository navigation
fix(parquet): validate Arrow writer shapes and map-key schemas - #11838
Conversation
|
@etseidl This one is short and sweet (and mainly tests); let me know what you think 🙇 |
|
merging up to fix ci issues |
|
Sorry @HippoBaro, this fell off my plate. I've added it to my queue for tomorrow. |
|
Oh, and can you enable CI in your fork? 🙏 https://github.com/apache/arrow-rs/blob/main/CONTRIBUTING.md#pull-requests-from-forks |
Reject mismatches between batch columns, planned Parquet leaves, physical column writers, and CDC chunkers instead of silently truncating zipped iteration or panicking on missing writers. Derive per-field leaf ranges from the target Arrow schema and verify the Arrow/Parquet leaf counts when creating column writers. Check batch, writer, and chunker counts before updating row-group accounting, and validate each field's actual leaf count before dispatching its writes. Preserve compatible dense, dictionary, and run-end encoded representations. Validate map-key schemas when creating an Arrow writer, including when an explicitly supplied Parquet schema bypasses Arrow-to-Parquet conversion. Add regression coverage for shape mismatches, invalid map-key schemas, and reachable versus masked or unreferenced map-key nulls. Signed-off-by: Hippolyte Barraud <[email protected]>
70b3d55 to
d2763be
Compare
|
Thanks @etseidl! I've rebased, and CI should now be running on my fork. Let me know if there's anything else I need to do 🙇 |
There was a problem hiding this comment.
Thanks @HippoBaro. It took awhile, but this looks correct to me. Looks like there's a CI issue to fix.
|
Thanks @etseidl! The CI failure seems to be failing to find a Darwin host to run tests on https://github.com/HippoBaro/arrow-rs/actions/runs/40522283146/job/122252954680 I have no idea how our CI setup is meant to work, but I doubt GitHub is giving free CI runs on macs do they? EDIT: They do. There is the actual error:
After a while the job failed instead of being queued indefinitely. I'll retry the failed job and we'll see if GH has enough cycles to spare this time 🤞 EDIT 2: It now passes https://github.com/HippoBaro/arrow-rs/actions/runs/40522283146 |
|
Thank you @etseidl and @Rich-T-kid! |
Which issue does this PR close?
Rationale for this change
See #11837. Structural mismatches between the input batch, declared schemas, and column writers should produce descriptive errors rather than silently ignore columns or panic. Map-key schema constraints should also be enforced when an explicit Parquet schema bypasses Arrow-to-Parquet conversion.
What changes are included in this PR?
Reject mismatches between batch columns, planned Parquet leaves, physical column writers, and CDC chunkers instead of silently truncating zipped iteration or panicking on missing writers.
Derive per-field leaf ranges from the target Arrow schema and verify the Arrow/Parquet leaf counts when creating column writers. Check batch, writer, and chunker counts before updating row-group accounting, and validate each field's actual leaf count before dispatching its writes. Preserve compatible dense, dictionary, and run-end encoded representations.
Validate map-key schemas when creating an Arrow writer, including when an explicitly supplied Parquet schema bypasses Arrow-to-Parquet conversion.
Are these changes tested?
Add regression coverage for shape mismatches, invalid map-key schemas, and reachable versus masked or unreferenced map-key nulls. All tests passing.
Are there any significant user-facing changes?
No public API changes. Invalid schema or column-count combinations that were previously accepted, silently ignored, or caused a panic now return descriptive errors.