Repository navigation
test(scan): Support split and parallel scans - Part-5: end-to-end validation and benchmark - #1168
Open
kamcheungting-db wants to merge 5 commits into
Open
kamcheungting-db wants to merge 5 commits into
kamcheungting-db wants to merge 5 commits into
Conversation
…el Arrow reader Add ParallelScanReader, which reads the groups of a FileScanTaskGroupStream with a fixed set of workers and returns one Arrow C stream. - Each worker owns a FileScanTaskReader with residual enforcement forced on. Workers claim groups through a planning token: only one calls the group stream at a time, outside all locks. - Completed batches enter an output queue bounded by batch count and by charged bytes. Producers are admitted in FIFO order; a batch larger than the byte budget is admitted only into an empty queue. - ArrowBatchSizer charges a batch as the checked sum of its Arrow buffer spans, after preflighting offsets, lengths, buffer counts, and every layout-dependent size product for overflow. List views and run-end encoded arrays are rejected. - Each task stream's schema is compared with the projected schema before its batches are read. - The first planning, read, schema, or sizing error stops new work, releases queued batches, and is reported from get_next as EIO with the file and byte range in get_last_error. Releasing the stream between callbacks stops and joins the workers. - iceberg_data now links Threads unconditionally. Co-authored-by: Isaac <no-reply@databricks.com>
…date GCC and AppleClang reject a template parameter that shares the member function's name. Also replace C-style arrays in the batch sizer tests. Co-authored-by: Isaac <no-reply@databricks.com>
kamcheungting-db
force-pushed
the
feat/parallel-scan-e2e
branch
from
November 23, 2026 20:25
745a55b to
e092ed3
Compare
Use std::cmp_* for signed/unsigned comparisons and std::ranges::is_sorted. Co-authored-by: Isaac <no-reply@databricks.com>
…idation and benchmark Plan real tables with PlanTasksStream() and read them with ParallelScanReader, comparing the rows with PlanFilesStream() and the serial FileScanTaskReader and with independently expected values, for one and four workers and format versions 1-3: - multi-row-group Parquet files split by manifest offsets, by fixed ranges when offsets are missing, and by valid offsets that fall inside row groups instead of on their canonical starts - one large row group split into several ranges - many small files packed into groups - mixed Parquet and Avro files (Avro stays whole) - case-insensitive residual filters - position deletes carried into every split - absolute _row_id and _pos values across splits (v3) - releasing the stream between callbacks while workers are busy Add parallel_scan_benchmark (bundle builds with ICEBERG_BUILD_BENCHMARKS), which writes a large-file and a small-file local table and reports paired, order-alternated serial versus parallel trials with a bootstrapped median and 95% confidence interval of the speedup, end to end and for the read phase, plus planning time, queue peaks, producer wait, and peak RSS. It is not run in CI. Co-authored-by: Isaac <no-reply@databricks.com>
Use std::array for per-path samples and move main's body into the iceberg namespace instead of a using-directive. Co-authored-by: Isaac <no-reply@databricks.com>
kamcheungting-db
force-pushed
the
feat/parallel-scan-e2e
branch
from
November 24, 2026 00:36
e092ed3 to
2bcce44
Compare
This branch has not been deployed
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 this PR does
Validates
PlanTasksStream()→ParallelScanReaderon real tables, and adds a benchmark comparing it withPlanFilesStream()→FileScanTaskReader.End-to-end tests
New
parallel_table_scan_test.ccin the bundledscan_test, for format versions 1–3. Each case compares the parallel rows with the serial path and with independently expected rows, for 1 and 4 workers:split_offsets_row_idand_posvalues across splits (v3)Benchmark
parallel_scan_benchmark(built withICEBERG_BUILD_BENCHMARKS=ONand the bundle; not run in CI) writes two local tables:read.split.target-size= 16 MiB (16 split tasks)It runs paired, order-alternated serial and parallel trials with the same projection, filter, and batch size, and reports the bootstrapped median and 95% confidence interval of the paired speedup, end to end (scan creation through stream release) and for the read phase. It also reports planning time, queue peaks, producer wait, bytes read, Arrow-pool allocations, and peak RSS.
--filter=all-pass(the default) adds a residual that every row passes, so it is evaluated per row;--filter=noneomits it.Results
Release build, 32 hardware threads, local disk with a warm page cache, 10 paired trials, serial versus 8 workers.
The first two rows were measured with this PR plus Part-3.5 (#1166). Before it, the per-row residual evaluator did not scale across threads (8 workers were slower than one); #1166 removes the per-row
Literalconstruction that caused it.Worker sweep, large workload with the all-pass filter: serial 0.439s, then 0.418s / 0.234s / 0.142s / 0.078s with 1 / 2 / 4 / 8 workers.
Other measurements, per scan: planning under 2 ms; serial and parallel read the same bytes (327 MiB large, 57 MiB small) with about the same Arrow-pool allocations; the queue peaked at about 1.6 MB and 8 batches, with no oversized admissions and about 2 ms of total producer wait; peak RSS about 1 GB, including writing the tables.
The plan's acceptance rule (lower bound of the 95% interval above 1.0 for the large-file workload) holds with and without a residual filter, given #1166. Timings are not asserted in CI.
Checks
The full
ctestsuite passes.pre-commitis clean.Related
Part 1 #976 · Part 2a #1002 · Part 2b #1062 · Part 2c #1065 · Part 3 #1113 · Part 3.5 #1166 · Part 4 #1167.
This pull request and its description were written by Isaac.