Skip to content

Delta table scan should be optimized when deletion vectors don't exist [databricks] - #13980

Merged
jihoonson merged 18 commits into
NVIDIA:release/25.12from
jihoonson:fix-delta-split
Dec 13, 2025
Merged

Delta table scan should be optimized when deletion vectors don't exist [databricks]#13980
jihoonson merged 18 commits into
NVIDIA:release/25.12from
jihoonson:fix-delta-split

Conversation

@jihoonson

@jihoonson jihoonson commented Dec 8, 2025

Copy link
Copy Markdown
Collaborator

Fixes #13950 and #14004.

Description

Currently, when reading on GPU , the plugin cannot support certain optimizations for Delta tables such as file split or predicate pushdown if the deletion vectors are enabled for them. This change was made in #13843. However, we accidentally disabled the optimizations even for Delta tables without deletion vectors. This PR fixes this regression by disabling the optimization for Delta tables if they have deletion vectors.

Checklists

  • This PR has added documentation for new or modified features or behaviors.
  • This PR has added new tests or modified existing tests to cover new code paths.
    (Please explain in the PR description how the new code paths are tested, such as names of the new/existing tests that cover them.)
  • Performance testing has been performed and its results are added in the PR description. Or, an issue has been filed with a link in the PR description.

Signed-off-by: Jihoon Son <ghoonson@gmail.com>
@greptile-apps

greptile-apps Bot commented Dec 8, 2025

Copy link
Copy Markdown
Contributor

Greptile Overview

Greptile Summary

Fixed regression from PR #13843 where file splitting and predicate pushdown optimizations were disabled for all Delta tables. Now optimizations are only disabled when deletion vectors actually exist (fmt.hasTablePath is true).

Key Changes:

  • Changed hardcoded optimizationsEnabled = false to conditional logic that checks fmt.hasTablePath
  • When deletion vectors exist (hasTablePath is true), optimizations are disabled with a warning message
  • When deletion vectors don't exist, fmt.optimizationsEnabled is used, restoring the original behavior
  • Added comprehensive integration tests covering 5 scenarios including edge cases

Confidence Score: 4/5

  • This PR is safe to merge with the caveat that the correctness relies on Delta Lake's tablePath field accurately indicating deletion vector presence
  • The fix correctly addresses the regression by conditionally enabling optimizations. The logic is simple and mirrors the original pre-regression behavior. Comprehensive tests cover multiple edge cases. Score reduced from 5 to 4 because the fix relies on the assumption that fmt.hasTablePath accurately indicates deletion vector presence, which is not explicitly verified in this PR but appears to be a Delta Lake contract based on code comments
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
delta-lake/delta-33x/src/main/scala/com/nvidia/spark/rapids/delta/delta33x/Delta33xProvider.scala 5/5 Changed from hardcoded false to conditional logic based on hasTablePath, enabling file splitting and predicate pushdown when deletion vectors don't exist
delta-lake/delta-40x/src/main/scala/com/nvidia/spark/rapids/delta/delta40x/Delta40xProvider.scala 5/5 Same fix as Delta33x - changed from hardcoded false to conditional logic based on hasTablePath
integration_tests/src/main/python/delta_lake_test.py 5/5 Added comprehensive tests covering 5 scenarios: no DV, DV enabled without DVs, DV enabled with DVs, DV disabled with DVs, and DVs materialized with REORG

Sequence Diagram

sequenceDiagram
    participant DeltaScan as Delta Table Scan
    participant Provider as Delta33x/40x Provider
    participant FileFormat as DeltaParquetFileFormat
    participant GPU as GPU Parquet Reader
    
    DeltaScan->>Provider: toGpuParquetFileFormat(fmt)
    Provider->>Provider: Check fmt.hasTablePath
    
    alt Deletion Vectors Exist (hasTablePath == true)
        Provider->>Provider: Set optimizationsEnabled = false
        Provider->>Provider: Log warning about DV limitations
        Provider->>GPU: Create GpuDeltaParquetFileFormat(optimizationsEnabled=false)
        Note over GPU: File splitting DISABLED<br/>Predicate pushdown DISABLED
    else No Deletion Vectors (hasTablePath == false)
        Provider->>Provider: Use fmt.optimizationsEnabled
        Provider->>GPU: Create GpuDeltaParquetFileFormat(optimizationsEnabled=true)
        Note over GPU: File splitting ENABLED<br/>Predicate pushdown ENABLED
    end
    
    GPU->>DeltaScan: Return configured file format
Loading

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@jihoonson
jihoonson requested a review from a team December 8, 2025 22:15
@jihoonson

Copy link
Copy Markdown
Collaborator Author

build

Comment thread integration_tests/src/main/python/delta_lake_test.py Outdated
@jihoonson

Copy link
Copy Markdown
Collaborator Author

build

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@jihoonson

Copy link
Copy Markdown
Collaborator Author

build

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Comments (1)

  1. delta-lake/delta-33x/src/main/scala/com/nvidia/spark/rapids/delta/delta33x/Delta33xProvider.scala, line 76-91 (link)

    style: Check that Delta40xProvider also gets this fix. PR #13843 disabled optimizations unconditionally in delta-lake/delta-40x/src/main/scala/com/nvidia/spark/rapids/delta/delta40x/Delta40xProvider.scala:80, causing the same regression there.

3 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@jihoonson

Copy link
Copy Markdown
Collaborator Author

build

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Comments (1)

  1. delta-lake/delta-40x/src/main/scala/com/nvidia/spark/rapids/delta/delta40x/Delta40xProvider.scala, line 77 (link)

    syntax: Missing import for DeltaConfigs. This will cause a compilation error.

    Add this to the imports at the top of the file (line 24, similar to Delta33xProvider.scala:24).

4 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

razajafri
razajafri previously approved these changes Dec 10, 2025

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Comments (1)

  1. integration_tests/src/main/python/delta_lake_test.py, line 152 (link)

    style: Misleading skip reason. The condition not is_databricks_runtime() skips when NOT on Databricks, but the message says "not supported on Databricks". Consider updating to: "This test only runs on Databricks runtime"

4 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@jihoonson

Copy link
Copy Markdown
Collaborator Author

build

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@sameerz

sameerz commented Dec 10, 2025

Copy link
Copy Markdown
Collaborator

@jihoonson please retarget to release/25.12

Comment thread integration_tests/src/main/python/spark_session.py Outdated
@jihoonson
jihoonson changed the base branch from main to release/25.12 December 10, 2025 22:36

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@jihoonson jihoonson changed the title Delta tables should be splittable when deletion vectors don't exist [databricks] Delta tables should be splittable when deletion vectors don't exist Dec 12, 2025
@jihoonson

Copy link
Copy Markdown
Collaborator Author

build

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@gerashegalov gerashegalov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but stil questions about actionability of the warning

@jihoonson

Copy link
Copy Markdown
Collaborator Author

build

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

gerashegalov
gerashegalov previously approved these changes Dec 12, 2025

@gerashegalov gerashegalov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gerashegalov

Copy link
Copy Markdown
Collaborator

build

@pxLi

pxLi commented Dec 12, 2025

Copy link
Copy Markdown
Member

The previous trigger failed due to a blossom glitch.

  shell: /home/github/bin/bash -e {0}
  env:
    OPERATION: START-CI-JOB
    CI_SERVER: ***
    REPO_TOKEN: ***
Failed to create new client

rekicked

@pxLi pxLi changed the title Delta tables should be splittable when deletion vectors don't exist Delta tables should be splittable when deletion vectors don't exist [databricks] Dec 12, 2025
@pxLi

pxLi commented Dec 12, 2025

Copy link
Copy Markdown
Member

build

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@jihoonson

Copy link
Copy Markdown
Collaborator Author

build

@jihoonson jihoonson changed the title Delta tables should be splittable when deletion vectors don't exist [databricks] Delta table scan should be optimized when deletion vectors don't exist [databricks] Dec 13, 2025

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

override protected def toGpuParquetFileFormat(fmt: DeltaParquetFileFormat): FileFormat =
override protected def toGpuParquetFileFormat(fmt: DeltaParquetFileFormat): FileFormat = {
val optimizationsEnabled = if (fmt.hasTablePath) {
logWarning("Input Delta table has deletion vectors. Optimizations such as file splitting " +

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we printing this warning twice? Once here and again in the file format?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not. Perhaps your view is messed up by old commits. Please refresh your browser and check again.

@gerashegalov gerashegalov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jihoonson
jihoonson merged commit 9c95eaa into NVIDIA:release/25.12 Dec 13, 2025
65 checks passed
@sameerz sameerz added the bug Something isn't working label Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Delta parquet files are not split when they can be

6 participants