github-actions[bot] commented on code in PR #66627:
URL: https://github.com/apache/doris/pull/66627#discussion_r3759106673


##########
fe/fe-connector/fe-connector-iceberg/src/main/java/org/apache/doris/connector/iceberg/IcebergNestedColumnEvolution.java:
##########
@@ -87,10 +96,75 @@ public static void addColumn(Table table, 
ConnectorColumnPath path, IcebergColum
 
     /** Drops the nested field at {@code path}; its parent must resolve to a 
struct that contains the leaf. */
     public static void dropColumn(Table table, ConnectorColumnPath path) {
-        ResolvedColumnPath resolvedPath = 
validateNestedStructFieldPath(table.schema(), path, "drop");
-        UpdateSchema updateSchema = table.updateSchema();
-        updateSchema.deleteColumn(resolvedPath.getFullPath());
-        updateSchema.commit();
+        dropColumnWithPartitionSpecFence(table, path, true);
+    }
+
+    static void dropTopLevelColumn(Table table, String columnName) {
+        dropColumnWithPartitionSpecFence(table, 
ConnectorColumnPath.of(columnName), false);
+    }
+
+    private static void dropColumnWithPartitionSpecFence(
+            Table table, ConnectorColumnPath path, boolean nested) {
+        TableOperations operations = ((HasTableOperations) table).operations();
+        TableMetadata initial = operations.refresh();

Review Comment:
   [P1] Handle UUID-less format-v1 replacements
   
   Iceberg v1 makes the table UUID optional, and 1.10.1 parses old metadata 
with a null UUID. If such a table is dropped and recreated under the same 
identifier during this refresh, the replacement can also have a null UUID and 
reuse the same schema field IDs. Both `Objects.equals(null, null)` and the 
subtree-ID equality then pass, after which `SchemaUpdate` captures the 
replacement metadata as its base and the stale DROP deletes from the new table. 
This is the remaining v1 case of the table-identity thread: when the loaded 
UUID is absent, pin the metadata lineage/location and fail closed on a refresh 
change (or otherwise establish non-null identity), and add a missing-UUID 
replacement regression.
   



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to