[VL][Delta] Guard DV DML row-index scans#12215
Draft
malinjawi wants to merge 8 commits into
Draft
Conversation
Keep Delta DV DML row-index target scans on Spark unless native DML row-index scanning and native write are explicitly enabled. Preserve the Spark Project/Filter subtree above the fallback scan and add Delta 3.3/4.0 plan-shape coverage for metadata row-index on and off. Validation: JAVA_HOME=/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home ./build/mvn test-compile -pl backends-velox -am -Pjava-17,spark-3.5,backends-velox,hadoop-3.3,spark-ut,delta -DskipTests Validation: JAVA_HOME=/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home ./build/mvn test-compile -pl backends-velox -am -Pjava-17,spark-4.0,scala-2.13,backends-velox,hadoop-3.3,spark-ut,delta -DskipTests Validation: git diff --cached --check
|
Run Gluten Clickhouse CI on x86 |
|
Run Gluten Clickhouse CI on x86 |
|
Run Gluten Clickhouse CI on x86 |
|
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?
This PR is the next draft split in the Delta deletion-vector MoR stack. It is stacked after #12197 and #12198, and is opened early to get CI signal while those reviewer-requested scan splits continue through review.
It adds a correctness-first DML row-index scan guard for Delta DV DELETE/MoR planning. The goal is to preserve safe fallback behavior for DML target scans until native row-index scan execution is proven for the required Delta table shapes.
Main changes:
DeltaDeletionVectorDmlUtilsto detect Delta DML row-index scan shapesDeltaDmlRowIndexScanBenchmarkfor Delta 3.3 and Delta 4.0 so scan-guard evidence can be collected separately from the later DELETE command benchmarkThis PR is intentionally safety-only:
Benchmark status:
This PR currently preserves Spark fallback for the protected DML row-index scan shape, so it is not claiming a native performance win. The benchmark harness reports plan shape, DELETE timing, validation timing, active files, files with DVs, DV cardinality, DV payload bytes, final row count, and deleted-row pattern.
Local Spark baseline evidence on 2026-06-01, Apple M2 Pro, Spark 3.5 profile:
Results:
The guarded Gluten fallback benchmark mode is intentionally present in the harness but still needs native runtime evidence from CI or a local macOS native build, because this machine does not currently have
darwin/aarch64/libgluten.dylib.Issue: #11901
How was this patch tested?
Validation run locally on 2026-06-01:
env JAVA_HOME=/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home PATH=/opt/homebrew/opt/openjdk@17/bin:$PATH ./build/mvn -q test-compile -pl backends-velox -am -Pjava-17,spark-3.5,backends-velox,hadoop-3.3,spark-ut,delta -DskipTestsenv JAVA_HOME=/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home PATH=/opt/homebrew/opt/openjdk@17/bin:$PATH ./build/mvn -q test-compile -pl backends-velox -am -Pjava-17,spark-4.0,scala-2.13,backends-velox,hadoop-3.3,spark-ut,delta -DskipTestsgit diff --check/tmp/delta-dml-row-index-scan-benchmark-spark-all.txtLocal focused runtime execution with Gluten enabled is still blocked by the missing local macOS native Gluten library (
darwin/aarch64/libgluten.dylib), so this draft PR is relying on CI or a compatible local native build for the guarded fallback runtime lane.Follow-up CI compatibility fix on 2026-06-01 at
f3135560c7a3d7a0dfedc1f64267c9a529e7a970:ParquetFileFormat.ROW_INDEX_TEMPORARY_COLUMN_NAMEin commongluten-deltacode with the stable temporary column name literal so Spark 3.3 and Spark 3.4 compile.git diff --checkenv JAVA_HOME=/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home PATH=/opt/homebrew/opt/openjdk@17/bin:$PATH ./build/mvn -q test-compile -pl gluten-delta -am -Pjava-17,spark-3.3,backends-velox,hadoop-3.3,spark-ut,delta -DskipTestsenv JAVA_HOME=/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home PATH=/opt/homebrew/opt/openjdk@17/bin:$PATH ./build/mvn -q test-compile -pl gluten-delta -am -Pjava-17,spark-3.4,backends-velox,hadoop-3.3,spark-ut,delta -DskipTestsenv JAVA_HOME=/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home PATH=/opt/homebrew/opt/openjdk@17/bin:$PATH ./build/mvn -q test-compile -pl gluten-delta -am -Pjava-17,spark-3.5,backends-velox,hadoop-3.3,spark-ut,delta -DskipTestsenv JAVA_HOME=/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home PATH=/opt/homebrew/opt/openjdk@17/bin:$PATH ./build/mvn -q test-compile -pl gluten-delta -am -Pjava-17,spark-4.0,scala-2.13,backends-velox,hadoop-3.3,spark-ut,delta -DskipTestsWas this patch authored or co-authored using generative AI tooling?
Generated-by: IBM BOB