[GLUTEN][VL] Move Delta deletion vector reads off the driver - #12836
Draft
malinjawi wants to merge 7 commits into
Draft
[GLUTEN][VL] Move Delta deletion vector reads off the driver#12836malinjawi wants to merge 7 commits into
malinjawi wants to merge 7 commits into
Conversation
…ization DeltaScanTransformer already knows the Delta table root via relation.location (a TahoeFileIndex, which PreparedDeltaFileIndex also extends). Thread that path into DeltaDeletionVectorScanInfo.normalize so it no longer re-derives the root from a file path via _delta_log existence probing -- one FileSystem.exists() (an HTTP HEAD on object stores) per partition. normalize gains an optional tablePath parameter; when absent it falls back to the previous resolveTablePath heuristic, so non-TahoeFileIndex locations (e.g. DeltaParquetFileFormat scans without a Tahoe index) and the public single-file extract entry point are unchanged. Add a test to DeltaDeletionVectorScanInfoSuite (delta33 and delta40) asserting the supplied-path and derived-path branches materialize an identical DV payload.
…blePath fallback Now that DeltaScanTransformer passes the table root from TahoeFileIndex.path, make it the single source of truth for DV materialization and remove the previous file-path-derivation fallback. - DeltaDeletionVectorScanInfo.normalize takes a required tablePath: Path (no Option, no fallback); partitionColumnCount is dropped since only the walk-up used it. - Delete resolveTablePath / isDeltaTablePath / unescapePathName and their per-partition _delta_log FileSystem.exists() probing. - DeltaScanTransformer materializes DVs only when relation.location is a TahoeFileIndex (which also covers PreparedDeltaFileIndex); other locations carry no Delta DV metadata and keep the generic split. - Update the public single-file extract(spark, file, tablePath), the delta23/24 stubs, the benchmark, and the suites accordingly. Net ~160 fewer lines. The Hadoop-conf caching and raw on-disk DV byte reading optimizations are retained.
|
Run Gluten Clickhouse CI on x86 |
…-range-read # Conflicts: # docs/Configuration.md # gluten-delta/src/main/scala/org/apache/gluten/execution/DeltaScanTransformer.scala # gluten-delta/src/test/scala/org/apache/gluten/execution/DeltaSuite.scala
Contributor
Author
|
Run Gluten Clickhouse CI |
|
Run Gluten Clickhouse CI on x86 |
|
Run Gluten Clickhouse CI on x86 |
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 changes are proposed in this pull request?
Note
This draft is stacked on #12612. The first three commits are the authoritative
TahoeFileIndextable-root work from that PR; the final two commits are this change. The stack should be rebased ontomainafter #12612 is merged.Move on-disk Delta deletion-vector payload reads off the Spark driver and add an opt-in path that reads the stored DV range directly through Velox.
The current native scan eagerly opens every DV sidecar, reads and checksum-validates the bitmap, and embeds the payload bytes into the split before Spark submits tasks. On a 2,461-file S3 table this added approximately 100 seconds to each physical scan while the executors were idle.
This patch introduces two compatible execution paths:
FileHandleFactoryandBufferedInputBuilder, allowing existing split preloading, I/O concurrency, andAsyncDataCacheto apply.The native reader validates the four-byte stored length, payload bounds, CRC32, roaring bitmap encoding, and expected cardinality before applying row filtering. Inline DVs continue to use the existing JVM-materialized byte field. The original protobuf field is retained for compatibility and rollback.
The native path is gated by:
spark.gluten.sql.columnar.delta.deletionVector.nativeRangeRead.enabled=trueIt is disabled by default and takes precedence over
deferPayloadRead.enabled. Setting it back tofalsereturns to executor-JVM materialization; settingspark.gluten.sql.columnar.filescan=falseremains the broader rollback.The patch also adds driver/task DV metrics and native runtime counters for descriptor preparation, read attempts, bytes, and elapsed read time.
How was this patch tested?
./dev/format-scala-code.sh./dev/format-cpp-code.shwith clang-format 15.0.7./dev/gen-all-config-docs.shgit diff --checkvelox_delta_read_testtarget.DeltaDeletionVectorScanInfoSuite: 7 tests passed, including concurrent deferred materialization, failed-read retry, authoritative native descriptor handoff, and zero JVM payload reads.GlutenRuntimeConfigSuite: 5 tests passed.The native test executable cannot run on the development macOS host because an unrelated Folly F14 assertion aborts during static initialization before GoogleTest begins. The target compiles and links successfully; Linux CI and the S3 benchmark are required before enabling the opt-in native path by default.
Matched S3 deletion-vector benchmark
The fix was validated on Spark 3.5.4 using one unchanged SF2500
store_salesDelta snapshot with 2,461 data files and 2,461 active deletion vectors. The snapshot contains 7,199,920,789 original rows, 720,032,919 deleted rows, and 6,479,887,870 remaining rows.All arms used the same 8 workers, 15 executor cores per worker, 240 default/shuffle parallelism, snapshot, and query order:
count(*);sum(ss_ext_sales_price);sum(ss_net_profit).truefalsefalsefalsetruetruetruetruetruetruetruetrueThe fixed median is 21.748s: 11.86x faster than the same-image legacy control, 3.51x faster than vanilla Spark, and 5.90x faster than the Gluten file-scan fallback end to end. Considering only the two physical scans, the fixed median is 14.264s versus 251.053s for the legacy control, a 17.60x speedup. The four fixed physical-scan sums have a 1.0% range.
Correctness and activation gates passed:
DeltaScanTransformer.The fixed path has four repetitions. The vanilla, fallback, and same-image legacy controls currently have one repetition each; randomized control repetitions are still recommended before treating the ratios as final external performance claims.
Was this patch authored or co-authored using generative AI tooling?
Generated-by: IBM BOB