You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/06/05 05:39:21 UTC

[GitHub] [hive] pvary commented on a change in pull request #2351: HIVE-25200: Alter table add columns support for Iceberg tables

pvary commented on a change in pull request #2351:
URL: https://github.com/apache/hive/pull/2351#discussion_r645946009



##########
File path: iceberg/iceberg-catalog/src/main/java/org/apache/iceberg/hive/HiveSchemaUtil.java
##########
@@ -134,6 +136,28 @@ public static Type convert(TypeInfo typeInfo) {
     return HiveSchemaConverter.convert(typeInfo, false);
   }
 
+  /**
+   * Produces the difference of two FieldSchema lists by only taking into account the field name and type.
+   * @param from List of fields to subtract from
+   * @param to List of fields to subtract
+   * @return the result list of difference
+   */
+  public static List<FieldSchema> schemaDifference(List<FieldSchema> from, List<FieldSchema> to) {
+    List<FieldSchema> result = new LinkedList<>(from);

Review comment:
       Why use `List` as an input? `Collection` might serve as well.
   Why not use lambdas?
   Maybe just create a name/type map from the `to` list and just filter the results with a lambda? 




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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org