[spark] Match BINARY partition values by content in partition management #11226
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
LuciferYang
Purpose
PaimonPartitionManagement.listPartitionIdentifierscompared values withObjects.equals, so BINARY values (byte[]) never matched:SHOW PARTITIONSwith a spec found nothing, full-specDROP PARTITIONand Spark 4.2'sDESCRIBE ... PARTITIONfailed,ADD PARTITIONof an existing value succeeded, and partialTRUNCATEfailed. It now usesObjects.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 EXTENDEDuses the same predicate.DELETEhas the same problem: #11291.Tests
PaimonPartitionManagementTest: BINARYSHOW PARTITIONS,ADD PARTITION,DROP PARTITION, partialTRUNCATE. Next to a NULL partition, dropping a blank BINARY or STRING value removes only it;SHOW TABLE EXTENDEDreports its rows. PartialTRUNCATEof blank and non-UTF-8 BINARY values;TRUNCATEof 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 withoutmetastore.partitioned-table.FileStoreCommitTest: adt-only predicate also drops anhrpartition written after it was built.Spark42CompatibilityTest:DESCRIBE ... PARTITIONon a BINARY column.Except the batch-read, TIMESTAMP(9) and expiration tests, which pin regressions found in review, the Spark tests fail on master.