stevenzwu commented on code in PR #6313:
URL: https://github.com/apache/iceberg/pull/6313#discussion_r1046608479


##########
flink/v1.16/flink/src/main/java/org/apache/iceberg/flink/sink/FlinkAppenderFactory.java:
##########
@@ -216,7 +241,8 @@ public EqualityDeleteWriter<RowData> newEqDeleteWriter(
   @Override
   public PositionDeleteWriter<RowData> newPosDeleteWriter(
       EncryptedOutputFile outputFile, FileFormat format, StructLike partition) 
{
-    MetricsConfig metricsConfig = MetricsConfig.fromProperties(props);
+    MetricsConfig metricsConfig =
+        table != null ? MetricsConfig.forTable(table) : 
MetricsConfig.fromProperties(props);

Review Comment:
   this should be `forPositionDelete`



##########
flink/v1.16/flink/src/main/java/org/apache/iceberg/flink/sink/FlinkAppenderFactory.java:
##########
@@ -99,7 +122,8 @@ private RowType lazyPosDeleteFlinkSchema() {
 
   @Override
   public FileAppender<RowData> newAppender(OutputFile outputFile, FileFormat 
format) {
-    MetricsConfig metricsConfig = MetricsConfig.fromProperties(props);
+    MetricsConfig metricsConfig =
+        table != null ? MetricsConfig.forTable(table) : 
MetricsConfig.fromProperties(props);

Review Comment:
   `MetricsConfig.fromProperties` is deprecated. I am wondering if we should 
ensure `table` is never null? That would require changing the current 2 
constructors (technically breaking) without adding a new constructor. but this 
class should be an `@Internal` class. what do you think? @pvary @hililiwei 
@chenjunjiedada 



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to