JingsongLi commented on code in PR #10964:
URL: https://github.com/apache/paimon/pull/10964#discussion_r4451312277


##########
paimon-hive/paimon-hive-catalog/src/main/java/org/apache/paimon/hive/HiveCatalog.java:
##########
@@ -488,8 +488,23 @@ private void createPartitionsUtil(
     public void dropPartitions(Identifier identifier, List<Map<String, 
String>> partitions)
             throws TableNotExistException {
         TableSchema schema = this.loadTableSchema(identifier);
-        CoreOptions options = CoreOptions.fromMap(schema.options());
-        boolean tagToPart = options.tagToPartitionField() != null;
+        dropPartitionsFromMetastore(identifier, partitions, schema);
+        if (CoreOptions.fromMap(schema.options()).tagToPartitionField() == 
null) {
+            super.dropPartitions(identifier, partitions);
+        }
+    }
+
+    @Override
+    public void dropPartitionsFromMetastore(
+            Identifier identifier, List<Map<String, String>> partitions)
+            throws TableNotExistException {
+        dropPartitionsFromMetastore(identifier, partitions, 
loadTableSchema(identifier));

Review Comment:
   [P2] Keep synthetic done values out of the typed branch scan
   
   This new metadata-only path still sends `20230101.done` into 
`removePartitionsExistsInOtherBranches`, whose `withPartitionsFilter` converts 
it to the partition's INT type. I reproduced this on the current head by adding 
only `table.createBranch("other")` before expiration in 
`testExpireIntegerPartitionsWithDoneMarkers`: both `markDone=false` and `true` 
fail with `NumberFormatException: For input string: "20230101.done"` at this 
call, after the ordinary partition has already been dropped. The other branch 
can be empty. Thus tables with branches still hit the reported failure despite 
the metadata-only API. Please check branch ownership using the underlying 
ordinary partition values (while retaining the synthetic specs for HMS 
removal), and add this branch case so marker cleanup avoids typed conversion 
without discarding cross-branch protection.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to