← Back to Pull requests

[spark] Describe a partition by its values on every Spark version #11419

Open
unknown opened this pull request with 266 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 24, 2026 12:09 UTC
Author

Purpose

Closes #11383.

Spark 4.2 (SPARK-39660) plans DESCRIBE ... PARTITION as DescribeTablePartition, which PaimonStrategy does not match, so on 4.2 and 4.3 Spark's own exec prints the raw loadPartitionMetadata map. Before 4.2, PaimonDescribeTableExec matches spec strings to catalog partition names, so blank, NULL, DATE, TIMESTAMP and m = '09' partitions report "Found 0 matching partitions".

This PR resolves the spec by value on every version, and a 4.2-module strategy sends DescribeTablePartition to PaimonDescribeTableExec. Statistics come from the table's own scan of the partition columns, for SHOW TABLE EXTENDED ... PARTITION too. DESCRIBE also finds a partition registered in a REST catalog before its first write.

Behavior changes before 4.2:

  • Plain DESCRIBE fails on a missing partition too.

  • The NULL partition is = NULL, not = '__DEFAULT_PARTITION__'.

  • REST-reported and system-table statistics are no longer shown.
  • On every version, fallback branch, time travel, scan.bucket and query auth apply as in a read.

    Tests

  • DescribeTableTestBase: lookup by value (blank vs NULL, an upper-case column name, the default partition name, a missing partition), INT/DATE/TIMESTAMP/BINARY values, a microsecond value for a millisecond timestamp column, a DV table whose files are all at level 0, a partition only the fallback branch holds (DESCRIBE and SHOW), session time travel, and t$audit_log.

  • DescribeRegisteredPartitionTest: on the REST test server, a partition registered through Catalog.createPartitions before its first write can be described, except under time travel.

  • UnreportedPartitionStatisticsTest: the fixture injects unknown statistics through loadPartitionMetadata instead of the catalog listing.

  • SparkPartitionMetadataAuthTest: a user granted only the partition columns can describe a partition, also of a metastore.partitioned-table table outside a REST catalog.

  • paimon-spark-4.2 now runs DescribeTableTest, DescribeRegisteredPartitionTest and UnreportedPartitionStatisticsTest, so the spark42 and spark43 lanes cover them.
  • Diff: 266 lines (+199 / -67) across 3 files Reviewer: LuciferYang Review duration: 6774m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.39) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 266 lines diff across 3 files
    0.39
    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.334
    Real PR Conversation Timeline
    1 comments
    "Review active on #11419"
    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.4% (MEDIUM) · Higher = larger blast radius
    39.4%
    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.0% · Safe to merge
    21.0%
    Repository