openinx commented on a change in pull request #2556:
URL: https://github.com/apache/iceberg/pull/2556#discussion_r627975342



##########
File path: api/src/main/java/org/apache/iceberg/types/TypeUtil.java
##########
@@ -181,10 +183,24 @@ public static Schema assignFreshIds(int schemaId, Schema 
schema, NextID nextId)
    * @return a structurally identical schema with new ids assigned by the 
nextId function
    */
   public static Schema assignFreshIds(Schema schema, Schema baseSchema, NextID 
nextId) {
-    return new Schema(TypeUtil
-        .visit(schema.asStruct(), new AssignFreshIds(schema, baseSchema, 
nextId))
-        .asNestedType()
-        .fields());
+    Types.StructType freshSchemaStruct = TypeUtil

Review comment:
       In theory, a `schema` is composed by `schemaId`, `fields`,  `aliases`, 
`identifierFieldIds` . We will need to maintain all those members when refresh 
or reassign field ids based on the old schema,  by default we should pass the 
old schema's  info to the fresh schema if people don't provide a necessary info 
to fill.
   
   Getting this work into a new PR looks good to me.




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

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