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



##########
File path: core/src/main/java/org/apache/iceberg/avro/Avro.java
##########
@@ -190,8 +189,48 @@ private CodecFactory codec() {
       // add the Iceberg schema to keyValueMetadata
       meta("iceberg.schema", SchemaParser.toJson(schema));
 
+      Context context = createContextFunc.apply(config);
+      CodecFactory codec = context.codec();
+
       return new AvroFileAppender<>(
-          schema, AvroSchemaUtil.convert(schema, name), file, writerFunc, 
codec(), metadata, metricsConfig, overwrite);
+          schema, AvroSchemaUtil.convert(schema, name), file, writerFunc, 
codec, metadata, metricsConfig, overwrite);
+    }
+
+    private static class Context {

Review comment:
       Nit:  This class `Context` is private static class right, so I think all 
the following public methods can be marked as package-private, right ?

##########
File path: core/src/main/java/org/apache/iceberg/avro/Avro.java
##########
@@ -190,8 +189,48 @@ private CodecFactory codec() {
       // add the Iceberg schema to keyValueMetadata
       meta("iceberg.schema", SchemaParser.toJson(schema));
 
+      Context context = createContextFunc.apply(config);
+      CodecFactory codec = context.codec();
+
       return new AvroFileAppender<>(
-          schema, AvroSchemaUtil.convert(schema, name), file, writerFunc, 
codec(), metadata, metricsConfig, overwrite);
+          schema, AvroSchemaUtil.convert(schema, name), file, writerFunc, 
codec, metadata, metricsConfig, overwrite);
+    }
+
+    private static class Context {

Review comment:
       Nit:  This class `Context` is private static class, so I think all the 
following public methods can be marked as package-private, right ?




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