← Back to Pull requests

[spark] Match BINARY partition values by content in partition management #11226

Closed
unknown closed this pull request without merging on Nov 22, 2026 11:00 UTC
View on GitHub
unknown unknown commented on Nov 17, 2026 13:49 UTC
Author

Purpose

PaimonPartitionManagement.listPartitionIdentifiers compared values with Objects.equals, so BINARY values (byte[]) never matched: SHOW PARTITIONS with a spec found nothing, full-spec DROP PARTITION and Spark 4.2's DESCRIBE ... PARTITION failed, ADD PARTITION of an existing value succeeded, and partial TRUNCATE failed. It now uses Objects.deepEquals.

DROP and TRUNCATE passed string specs to the commit, which parses them back, so a blank value (named like NULL), a non-UTF-8 BINARY value or a TIMESTAMP's legacy name in a non-UTC JVM removed another partition or none. They now build a typed partition predicate, with timestamps at the column's precision, and pass it to a new internal TableCommitImpl.truncatePartitions(PartitionPredicate), which drops what it matches in each commit attempt's latest snapshot. A catalog that takes partition drops, such as Hive's, still gets names, and values whose name does not parse back are rejected. SHOW TABLE EXTENDED uses the same predicate.

DELETE has the same problem: #11291.

Tests

  • PaimonPartitionManagementTest: BINARY SHOW PARTITIONS, ADD PARTITION, DROP PARTITION, partial TRUNCATE. Next to a NULL partition, dropping a blank BINARY or STRING value removes only it; SHOW TABLE EXTENDED reports its rows. Partial TRUNCATE of blank and non-UTF-8 BINARY values; TRUNCATE of a partition batch reads skip; DROP of a TIMESTAMP whose legacy name parses as another partition, and of a TIMESTAMP(9) at stored precision; an expired partition survives DROP and TRUNCATE; DROP reaches a non-Hive partition handler, a blank value does not; the default name as a literal fails.

  • DDLWithHiveCatalogTestBase: on Hive, dropping a blank partition fails and keeps every row, with and without metastore.partitioned-table.

  • FileStoreCommitTest: a dt-only predicate also drops an hr partition written after it was built.

  • Spark42CompatibilityTest: DESCRIBE ... PARTITION on a BINARY column.
  • Except the batch-read, TIMESTAMP(9) and expiration tests, which pin regressions found in review, the Spark tests fail on master.

    Diff: 266 lines (+199 / -67) across 3 files Reviewer: LuciferYang Review duration: 7031m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.39) × (1 − Review Confidence (0.60)). 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.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    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.334
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #11226"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% 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: 60.5% · Lower = rushed or shallow review
    60.5%
    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: 15.5% · Safe to merge
    15.5%
    Repository