ZihanLi58 commented on a change in pull request #3385:
URL: https://github.com/apache/gobblin/pull/3385#discussion_r706395477



##########
File path: 
gobblin-iceberg/src/main/java/org/apache/gobblin/iceberg/writer/IcebergMetadataWriter.java
##########
@@ -422,6 +465,21 @@ private void 
computeCandidateSchema(GobblinMetadataChangeEvent gmce, TableIdenti
     }
   }
 
+  /**
+   * Add a partition column to the schema and partition spec
+   * @param table incoming iceberg table
+   * @param fieldName name of partition column
+   * @param type datatype of partition column
+   * @return table with updated schema and partition spec
+   */
+  private Table addPartitionToIcebergTable(Table table, String fieldName, 
String type) {
+    if(!table.schema().columns().stream().anyMatch(x -> 
x.name().equalsIgnoreCase(fieldName))) {
+      table.updateSchema().addColumn(fieldName, 
Types.fromPrimitiveString(type)).commit();
+      table.updateSpec().addField(fieldName).commit();

Review comment:
       Can you update this to include the change we talk offline before we 
merge it?




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to