jackye1995 commented on a change in pull request #2556:
URL: https://github.com/apache/iceberg/pull/2556#discussion_r628560818
##########
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:
yes practically speaking the alias is not used in any code path related,
that was why I did not care about that when making the change. But from
correctness perspective I agree with @openinx that if the alias exists, we
should do the conversion just in case it is somehow used somewhere for that
purpose in the future.
What I am trying out is to change the `AssignFreshIds` visitor so that it
can update the id along the way for `alias` and `identifier`. Will update the
PR after completing the implementation.
--
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]