Commit 688b633
feat: auto-detect and configure Delta DV read strategy
Users no longer need to manually set
`spark.databricks.delta.deletionVectors.useMetadataRowIndex=false`.
Comet now registers a Catalyst optimizer rule (`CometDeltaDvConfigRule`)
via `CometSparkSessionExtensions.injectOptimizerRule` that automatically
sets the config when `COMET_DELTA_NATIVE_ENABLED=true`. The rule runs
in the optimizer phase which executes BEFORE Delta's planner strategies,
so the config takes effect for the SAME query where it's first needed.
Delta's default `useMetadataRowIndex=true` strategy applies DVs opaquely
inside `DeletionVectorBoundFileFormat` at read time — no plan-level
Filter is inserted, making it impossible for Comet's physical-plan
rewrite to detect and handle. Setting it to `false` forces Delta's
older strategy (Project + Filter + __delta_internal_is_row_deleted)
which our `stripDeltaDvWrappers` can recognize and route through
DeltaDvFilterExec.
Removed the manual config from CometDeltaNativeSuite's sparkConf.
Tests: succeeded 34, failed 0, canceled 0, ignored 0, pending 0
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 393507d commit 688b633
2 files changed
Lines changed: 37 additions & 9 deletions
File tree
- spark/src
- main/scala/org/apache/comet
- test/scala/org/apache/comet
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
52 | 86 | | |
53 | 87 | | |
54 | 88 | | |
| |||
Lines changed: 3 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
74 | 68 | | |
75 | 69 | | |
76 | 70 | | |
| |||
0 commit comments