Support quoted multiline fields in parallel CSV parsing#651
Merged
adsharma merged 3 commits intoJul 5, 2026
Conversation
Optimize CSV boundary seed scanning Add SIMD structural CSV parser path Update dataset submodule
Contributor
|
[edit - rebased and pushed ] |
Contributor
|
@rahul-iyer only one failure on windows to fix https://github.com/LadybugDB/ladybug/actions/runs/28725297352/job/85236841991 |
Contributor
|
Windows run with the proposed fix: https://github.com/LadybugDB/ladybug/actions/runs/28749519654 |
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.
This change adds a planned-range path for the parallel CSV reader so files with quoted newlines can
still use parallel parsing without splitting logical rows across workers.
The core change is a boundary-planning step that computes safe logical row ranges before worker parsing
begins. When MULTILINE_PARALLEL=true, the reader uses those planned ranges instead of naive fixed block
cuts. That lets workers parse independently while preserving correctness for multiline quoted fields.
What changed
Added MULTILINE_PARALLEL as a CSV reader option.
Added boundary planning for parallel CSV using CSVBoundaryScanner::planFixedChunkOverlap(...).
Added csv_boundary_scanner.cpp to the CSV reader build target.
Updated ParallelCSVReader to:
Kept the existing fixed-block path unchanged for non-multiline parallel reads.
Benchmark Results
Median of 3 runs. Dataset results came from /private/tmp/lbug_dataset_benchmark_counts_after_simd.csv.
The synthetic comparison came from /private/tmp/lbug_mode_benchmark_results.csv. In the dataset runs,
outputs were identical across modes for every case listed below.
dataset/snap/amazon0601/csv/amazon-edges.csvdataset/snap/twitter/csv/twitter-edges.csvdataset/ldbc-sf01/Comment.csvdataset/ldbc-sf01/Post.csvdataset/snap/facebook/edges.csvdataset/embeddings/embeddings-960-1k.csvclean_256mbmultiline_256mb