disable wrong parallel decompression for LOAD DATA#23620
Merged
mergify[bot] merged 5 commits intomatrixorigin:mainfrom Jan 29, 2026
Merged
disable wrong parallel decompression for LOAD DATA#23620mergify[bot] merged 5 commits intomatrixorigin:mainfrom
mergify[bot] merged 5 commits intomatrixorigin:mainfrom
Conversation
|
|
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.
What type of PR is this?
Which issue(s) this PR fixes:
issue #23618
What this PR does / why we need it:
Summary
Parallel LOAD DATA on compressed files is unsafe because the current implementation splits input by byte offsets and then tries to locate line boundaries on a compressed stream. This can cut rows in the middle, cause column misalignment, and finally write corrupted values (e.g., invalid DATE/DECIMAL). The issue manifests later as panics during query output (e.g., Date.ToBytes out-of-range).
Root Cause
ReadFileOffset computes offsets using Offset = previous + batchSize and then getTailSize on the compressed reader, which is not a valid line-boundary strategy for compressed streams. This leads to row corruption.
Fix (medium-cost path)
Keep parallel write, but disable parallel splitting for compressed files.
For compressed data, load is handled by a single reader (proper decompression + parsing), and the insert stage still runs in parallel.
Avoid the “string vector + cast projection” path for compressed files to prevent misalignment.
Tests
Added a unit test that asserts ReadFileOffset rejects compressed input.
This locks the unsafe behavior and prevents regression.
Note: If we later refactor to truly support parallel splitting for compressed files (e.g., with a splittable format), this test must be updated or removed.
Behavior After Fix
Compressed LOAD DATA no longer panics.
Parallelism is preserved on the write side; read-side splitting is disabled for compressed inputs.