openinx commented on a change in pull request #1974:
URL: https://github.com/apache/iceberg/pull/1974#discussion_r547617115



##########
File path: flink/src/main/java/org/apache/iceberg/flink/sink/FlinkSink.java
##########
@@ -184,7 +198,18 @@ public Builder writeParallelism(int newWriteParallelism) {
         }
       }
 
-      IcebergStreamWriter<RowData> streamWriter = createStreamWriter(table, 
tableSchema);
+      // Find out the equality field id list based on the user-provided 
equality field column names.
+      List<Integer> equalityFieldIds = Lists.newArrayList();
+      if (equalityFieldColumns != null && equalityFieldColumns.size() > 0) {
+        for (String column : equalityFieldColumns) {
+          org.apache.iceberg.types.Types.NestedField field = 
table.schema().findField(column);
+          Preconditions.checkNotNull(field, "Missing required equality field 
column '%s' in table schema %s",
+              column, table.schema());
+          equalityFieldIds.add(field.fieldId());
+        }
+      }

Review comment:
       Because the `FlinkSink` is an API which will be exposed to flink's 
DataStream users,   the concept of equality field id is harder to understand 
for those flink users.  Equality field column names will be more friendly. 




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

Reply via email to