← Back to Pull requests

Add auto-compact coverage for normalized timestamp partition grouping [databricks] #17062

Open
unknown opened this pull request with 279 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 20, 2026 16:15 UTC
Author

Fixes #17044.

Description

Delta Lake 4.3 (delta-io/delta#6624) groups OPTIMIZE files by normalized, typed partition values instead of raw partition strings. As a result, logically equal timestamp partition values written in different textual forms are compacted into one bin.

The plugin already groups this way on Delta 4.3 (Delta43xRuntimeShim.groupOptimizeFilesByPartition), and Delta 3.3–4.2 group by raw strings on both CPU and GPU. This PR changes no plugin code. It adds test coverage:

  • New test_auto_compact_mixed_timestamp_partition_forms (OSS Delta 4.3 only). It writes the same timestamp partition in two raw forms plus a logically different value, with normalizePartitionValuesOnRead on and off and with UTC and America/Los_Angeles session time zones. It asserts:

  • - a GPU write plan executed, and inline auto compaction ran on the GPU when expected;
    - CPU/GPU parity for file counts, data and OPTIMIZE metrics;
    - the equal forms merge into one file only when normalization is on, and the different value
    never merges.
  • test_delta_optimize_normalized_timestamp_partitions now also runs on Databricks 17.3+. txn.filterFiles already returns normalized partition values there, so GPU matches CPU without a code change.

  • The shared table creation and insert logic moved to delta_lake_utils.py.
  • Testing

    Run on GPU, Spark 4.0.1 with Delta 4.3.0, all passing:

  • the new auto-compact test (4 cases: 2 time zones × normalization on/off);

  • the existing OPTIMIZE and Z-order normalized-timestamp tests.
  • A mutation check (reverting Delta43xRuntimeShim to raw grouping) made the new and existing tests fail.

    Databricks 17.3 (400db173) and 18.3 (410db183): the compaction test passed on GPU, both parameter values.

    Checklists

    Documentation

  • Updated for new or modified user-facing features or behaviors

  • No user-facing change
  • Testing

  • Added or modified tests to cover new code paths

  • Covered by existing tests

  • Not required
  • Performance

  • Tests ran and results are added in the PR description

  • Issue filed with a link in the PR description

  • Not required — test-only change, no plugin code is modified
  • Diff: 279 lines (+209 / -70) across 3 files Reviewer: gerashegalov Review duration: 14702m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.40) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 279 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.337
    Real PR Conversation Timeline
    1 comments
    "Review active on #17062"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 39.6% (MEDIUM) · Higher = larger blast radius
    39.6%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 21.1% · Safe to merge
    21.1%