You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2019/08/02 19:50:30 UTC

[GitHub] [incubator-iceberg] rdblue commented on a change in pull request #244: [WIP] Add new Update schema API to support adding of all new fields detected based on a companion schema

rdblue commented on a change in pull request #244: [WIP] Add new Update schema API to support adding of all new fields detected based on a companion schema
URL: https://github.com/apache/incubator-iceberg/pull/244#discussion_r310275060
 
 

 ##########
 File path: core/src/main/java/org/apache/iceberg/SchemaUpdate.java
 ##########
 @@ -371,4 +455,54 @@ public Type primitive(Type.PrimitiveType primitive) {
     newFields.addAll(adds);
     return Types.StructType.of(newFields);
   }
+
+  private static class CompanionSchemaNewFieldsCollector extends TypeUtil.CompanionSchemaVisitor<TypeUtil.WrappedType> {
 
 Review comment:
   I like the approach of using a companion visitor to collect the new fields, but I think it is a little too complex to use ownership. I'd prefer an approach that looks like this:
   
   ```
   public T primitive(Type.PrimitiveType left, Type right);
   ```
   
   In that case, left or right might be null and you can compare the two. Left might be an int and right might be a long, for example. That way, you don't have a case where ownership is both.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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