Repository navigation
Conversation
StreamDecoder passed its skip_validation flag to dictionary batches only, so record batches were always validated. Pass it to the RecordBatchDecoder too, and cover StreamDecoder in the validation tests. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01PpXao5thfsWERyA3UQfLRf
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01PpXao5thfsWERyA3UQfLRf
|
run benchmark ipc_reader |
|
🤖 Benchmark starting (GKE) | trigger Target: ipc_reader Sharding factor: 1 (1 workers). Comparing stream-decoder-skip-validation (05ae983) to bfdcd26 (merge-base) diff Run configurationrun benchmark ipc_reader
shards: 1
Results will be posted when all workers finish. File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Target: ipc_reader Comparing stream-decoder-skip-validation (05ae983) to bfdcd26 (merge-base) diff Run configurationrun benchmark ipc_reader
shards: 1
DetailsPer-runner informationipc_reader — shard 1/1Node: gk3-benchmark-cluster-nap-4vpacm1r-837509ea-cqz7 Instance: c4a-highmem-16 (12 vCPU / 65 GiB) uname: BENCH_COMMAND: cargo bench --features=arrow,async,test_common,experimental,object_store --bench ipc_readerCPU Details (lscpu)Resource Usagebase (merge-base)
branch
File an issue against this benchmark runner |
|
@Dandandan are you planning to move on with this? I think it resolves some of DF perf issues with spilling |
|
wondering if I can steal this PR 🤔 |
|
@Dandandan I picked this changes in the separate PR #12094 |
|
closing in favor of #12094 |
# Which issue does this PR close? - Relates to apache/datafusion#26687. # Rationale for this change `StreamDecoder` has no benchmarks. As CONTRIBUTING.md asks, this adds them in their own PR so the benchmark runner can measure the `StreamDecoder::with_skip_validation` fix from apache#11552 against `main`. # What changes are included in this PR? Two benchmarks next to the `StreamReader` ones, `StreamDecoder/read_10` and `StreamDecoder/no_validation/read_10`. Both decode the same 10-batch stream from a single `Buffer`. The code is from apache#11552 by @Dandandan. # Are these changes tested? This PR only adds benchmarks. On `main` both take about 129 µs on an M5 Max, because `with_skip_validation` does not reach record batches yet. # Are there any significant user-facing changes? No. AI disclosure: The benchmarks come from apache#11552. Porting them to `main` and writing this description were done with Claude Code. I have reviewed every change and the benchmark results. Co-authored-by: Daniël Heres <[email protected]>
…oder (apache#12094) # Which issue does this PR close? - Relates to apache/datafusion#26687. This picks up apache#11552 by @Dandandan with the same fix, rebased on `main`. The benchmarks are split out into apache#12093. # Rationale for this change `StreamDecoder::with_skip_validation(true)` only applies to dictionary batches, so record batches are still fully validated. `StreamReader`, `FileDecoder` and the `arrow-flight` `FlightDataDecoder` all pass the flag through for record batches too. DataFusion's spill reader has called `StreamDecoder::new().with_skip_validation(true)` since apache/datafusion#21882. Because of this bug, every spilled batch is validated again when it is read back, including a UTF-8 check of every string. That undoes apache/datafusion#15454. # What changes are included in this PR? - Pass `skip_validation` to `RecordBatchDecoder` in `StreamDecoder::decode`. - Cover `StreamDecoder` in `expect_ipc_validation_error`. # Are these changes tested? Yes. `expect_ipc_validation_error` now checks that `StreamDecoder` rejects invalid data by default and accepts it when validation is skipped. Without the fix, the five `test_validation_of_invalid_*` tests fail on the new check. Benchmarks from apache#12093 on an M5 Max, `main` against this PR: | Benchmark | main | this PR | Change | |---|---|---|---| | `StreamDecoder/no_validation/read_10` | 129.0 µs | 6.18 µs | −95.2% | | `StreamDecoder/read_10` | 128.9 µs | 128.8 µs | no change | The `StreamReader` and `FileReader` benchmarks do not change. With arrow patched to this branch, DataFusion's `spill_io/StreamReader/read_100` drops from 9.59 ms to 8.48 ms (−11.5%). That benchmark reads 100 spilled batches of 8192 rows through `StreamDecoder`. After apache#12093 merges, rebasing this PR lets `run benchmark ipc_reader` confirm these numbers on the shared runner. # Are there any significant user-facing changes? No API changes, and validation is still on by default. Callers that pass `true` now skip validation for record batches too, as documented. AI disclosure: The fix, the test and this description were written with Claude Code. I have reviewed every change and the benchmark results. Co-authored-by: RIchard Baah <[email protected]>
This is significantly faster:
StreamDecoder/no_validation/read_10 │ 241 µs → 9.8 µs (−96%)