← Back to Pull requests

[Kernel] Add Snapshot.getClusteringColumnInfos() returning typed descriptors #6753

Closed
unknown closed this pull request without merging on May 13, 2026 22:12 UTC
View on GitHub
unknown unknown commented on May 08, 2026 23:29 UTC
Author

Which Delta project/connector is this regarding?

  • Spark

  • Standalone

  • Flink

  • Kernel

  • Other (fill in here)
  • Description

    Adds Snapshot.getClusteringColumnInfos() returning per-clustering-column descriptors with the physical column reference, logical column reference, and data type for each clustering column on the snapshot, cached on first access.

    The v1 Spark connector already has a ClusteringColumnInfo carrying the same physical/logical/data-type triple (ClusteringColumn.scala L68-L87). This PR surfaces the equivalent typed descriptor on the v2 Kernel Snapshot interface so callers no longer have to combine SnapshotImpl#getPhysicalClusteringColumns() with ColumnMapping.getLogicalColumnNameAndDataType and unpack a Tuple2 themselves.

    Optional<List<ClusteringColumnInfo>> infos = snapshot.getClusteringColumnInfos();
    infos.ifPresent(list -> list.forEach(info -> {
        info.getPhysicalColumn();   // multi-part physical name from delta.clustering domain
        info.getLogicalColumn();    // multi-part logical name resolved via column mapping
        info.getDataType();         // data type at the resolved logical path
    }));
    

    Changes

  • New public io.delta.kernel.clustering.ClusteringColumnInfo (@Evolving, @since 4.3.0): three fields + static factories resolve, resolveAll, resolveAllFromDomainJson. Constructor is package-private + @VisibleForTesting.

  • New default Snapshot.getClusteringColumnInfos(). Default body reads the delta.clustering domain and delegates the parse + resolve to ClusteringColumnInfo.resolveAllFromDomainJson (no internal- package types in the public interface).

  • SnapshotImpl overrides with a Lazy<> cache mirroring the existing lazyClusteringColumns pattern.

  • ClusteringMetadataDomain is hardened against incomplete domain JSON: a missing or null clusteringColumns field is coalesced to an empty list instead of NPE-ing on read.
  • How was this patch tested?

  • 6 integration tests in DeltaTableClusteringSuite (run under both V1 and V2 transaction-builder variants) covering column-mapping=id, unclustered, no-column-mapping, caching identity, nested-field clustering, and KernelException propagation for a stale domain.

  • 6 unit tests in SnapshotGetClusteringColumnInfosDefaultBodySuite using a StubSnapshot to exercise the default body directly (absent/populated/empty-list, missing-field coalescing, malformed JSON, unresolvable column).

  • All existing clustering and ClusteringMetadataDomain tests pass.
  • Does this PR introduce _any_ user-facing changes?

    No. New public API only.

    Diff: 354 lines (+265 / -89) across 4 files Reviewer: yyanyy Review duration: 7122m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.43) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 354 lines diff across 4 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    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
    Diff Size diff_size
    0.351
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #6753"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% 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: 42.5% (MEDIUM) · Higher = larger blast radius
    42.5%
    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: 56.8% · Lower = rushed or shallow review
    56.8%
    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: 18.4% · Safe to merge
    18.4%
    Repository