kamcheungting-db opened a new pull request, #1168: URL: https://github.com/apache/iceberg-cpp/pull/1168
> Stacked on #1167 (Part-4). Review only the last commit: `test(scan): Support split and parallel scans - Part-5`. ## What this PR does Validates `PlanTasksStream()` → `ParallelScanReader` on real tables, and adds a benchmark comparing it with `PlanFilesStream()` → `FileScanTaskReader`. ## End-to-end tests New `parallel_table_scan_test.cc` in the bundled `scan_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: - multi-row-group Parquet files split by manifest `split_offsets` - missing offsets, which use fixed-size ranges - valid offsets that fall inside row groups instead of on their canonical starts; every row is still read exactly once - one large row group split into several ranges (no-regression case) - many small files packed into groups - mixed Parquet and Avro files (Avro stays whole) - a case-insensitive residual filter - position deletes carried into every split (v2+) - absolute `_row_id` and `_pos` values across splits (v3) - releasing the stream between callbacks while workers are busy ## Benchmark `parallel_scan_benchmark` (built with `ICEBERG_BUILD_BENCHMARKS=ON` and the bundle; not run in CI) writes two local tables: - **large**: 4 Parquet files × 2M rows, 125k-row row groups, `read.split.target-size` = 16 MiB (16 split tasks) - **small**: 400 Parquet files × 2,000 rows 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=none` omits it. ### Results Release build, 32 hardware threads, local disk with a warm page cache, 10 paired trials, serial versus 8 workers. | Workload | Residual filter | Serial | 8 workers | Speedup, 95% CI | Before #1166 | |---|---|---|---|---|---| | Large | all-pass, per row | 0.432s | 0.064s | **6.72x**, [6.49, 6.93] | 0.80x (serial 0.834s) | | Small | all-pass, per row | 0.080s | 0.017s | **4.67x**, [4.63, 4.70] | 1.12x (serial 0.119s) | | Large | none | 0.257s | 0.043s | **6.20x**, [5.84, 6.29] | 6.50x | | Small | none | 0.059s | 0.014s | **4.24x**, [4.21, 4.31] | 4.36x | The first two rows were measured with this PR plus #1166. Before #1166, the per-row residual evaluator did not scale across threads (8 workers were slower than one); #1166 removes the per-row `Literal` construction 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 `ctest` suite passes. `pre-commit` is clean. ## Related Part 1 #976 · Part 2a #1002 · Part 2b #1062 · Part 2c #1065 · Part 3 #1113 · Part 4 #1167 · #1166. This pull request and its description were written by Isaac. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
