pvary commented on code in PR #14353:
URL: https://github.com/apache/iceberg/pull/14353#discussion_r2438677768


##########
data/src/main/java/org/apache/iceberg/data/BaseFileWriterFactory.java:
##########
@@ -150,8 +150,9 @@ protected BaseFileWriterFactory(
   public DataWriter<T> newDataWriter(
       EncryptedOutputFile file, PartitionSpec spec, StructLike partition) {
     EncryptionKeyMetadata keyMetadata = file.keyMetadata();
-    Map<String, String> properties = table.properties();
-    MetricsConfig metricsConfig = MetricsConfig.forTable(table);
+    Map<String, String> properties = table == null ? ImmutableMap.of() : 
table.properties();
+    MetricsConfig metricsConfig =
+        table == null ? MetricsConfig.getDefault() : 
MetricsConfig.forTable(table);

Review Comment:
   need to handle null table, as a few use-cases for FileAppanderFactory uses 
it without an actual table



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