Fix ORC corruption when compression block sizes differ[reduced-it] #17037
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 322 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.346
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #17037"
general
weight: 0.35
firestarman
Fixes #16807.
Description
ORC COALESCING and MULTITHREADED readers could silently corrupt data when combining compressed files with different compression block sizes. The generated in-memory ORC file inherited the first file's PostScript block size while copying compressed streams from every file.
This change treats compression block size as part of ORC combine compatibility for compressed streams and groups coalescing stripes by compression kind and effective block size. Files with mismatched compressed block sizes are decoded in separate batches. For uncompressed files, the nominal block size is ignored because it does not affect stream encoding, allowing files from different writers to remain combined.
When rebuilding a PostScript, the change also clears the inherited stripe-statistics length because the synthetic file does not contain stripe statistics.
The integration regression test writes three files with 4 KiB, 256 KiB, and 4 KiB compression blocks, verifies their size-sorted order exercises coalescing pre-grouping, and compares complete rows for COALESCING and both ordered and unordered MULTITHREADED readers. Unit tests cover uncompressed block-size normalization and clearing stripe-statistics length. Against the old plugin, the original regression reproduced corruption in both reader modes (CPU string-length sum 640000 versus GPU 117).
Validation:
OrcScanSuite: 20 passedtest_read_combined_orc_files_with_different_compression_sizes: 3 passedPerformance testing was not required because files with matching effective compression settings retain the existing grouping path, and uncompressed files with differing nominal block sizes remain combinable. Compressed files with mismatched settings must be split because combining them is not semantically valid; the previous result was corrupt and therefore has no valid performance baseline.
AI assistance was used to develop and validate this change. The author reviewed the final diff and PR description.
Checklists
Documentation
Testing
Performance