rdblue commented on a change in pull request #1978:
URL: https://github.com/apache/iceberg/pull/1978#discussion_r549452495
##########
File path: flink/src/main/java/org/apache/iceberg/flink/FlinkCatalog.java
##########
@@ -516,7 +530,26 @@ private static void commitChanges(Table table, String
setLocation, String setSna
}
static CatalogTable toCatalogTable(Table table) {
- TableSchema schema =
FlinkSchemaUtil.toSchema(FlinkSchemaUtil.convert(table.schema()));
+ TableSchema.Builder builder = TableSchema.builder();
+
+ // Add the table columns.
+ RowType rowType = FlinkSchemaUtil.convert(table.schema());
+ for (RowType.RowField field : rowType.getFields()) {
+ builder.field(field.getName(),
TypeConversions.fromLogicalToDataType(field.getType()));
+ }
+
+ // Add the primary keys.
+ String concatColumns = PropertyUtil.propertyAsString(table.properties(),
+ TableProperties.EQUALITY_FIELD_COLUMNS,
+ TableProperties.DEFAULT_EQUALITY_FIELD_COLUMNS);
+ String[] columns =
org.apache.commons.lang3.StringUtils.split(concatColumns, ",");
Review comment:
Same here. Could you use `Splitter` instead?
----------------------------------------------------------------
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]