advancedxy commented on code in PR #10352:
URL: https://github.com/apache/iceberg/pull/10352#discussion_r1675556183


##########
core/src/main/java/org/apache/iceberg/SchemaUpdate.java:
##########
@@ -533,6 +537,34 @@ private static Schema applyChanges(
       }
     }
 
+    Map<Integer, List<Integer>> specToDeletes = Maps.newHashMap();

Review Comment:
   We occurred a similar issue. There might be another option which simplifies 
this schema update logic, namely:
   1. Prevent dropping any source column if it's used in any spec in table's 
`specById`
   2. Introduce the `RemoveUnusedSpec` in 
https://github.com/apache/iceberg/pull/3462/files
   
   In that way, SchemaUpdate only needs to check `specById` instead of reading 
all the manifest files.
   
   To actually drop an unused partition source field, user should make sure all 
the data files wrote by that spec are rewrote or removed, then call 
`RemoveUnusedSpec` to drop that spec.



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to