yyanyy commented on a change in pull request #1946:
URL: https://github.com/apache/iceberg/pull/1946#discussion_r546085722
##########
File path: core/src/main/java/org/apache/iceberg/avro/AvroFileAppender.java
##########
@@ -27,22 +27,31 @@
import org.apache.avro.file.DataFileWriter;
import org.apache.avro.io.DatumWriter;
import org.apache.iceberg.Metrics;
+import org.apache.iceberg.MetricsConfig;
import org.apache.iceberg.exceptions.RuntimeIOException;
import org.apache.iceberg.io.FileAppender;
import org.apache.iceberg.io.OutputFile;
import org.apache.iceberg.io.PositionOutputStream;
+import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
class AvroFileAppender<D> implements FileAppender<D> {
private PositionOutputStream stream = null;
private DataFileWriter<D> writer = null;
+ private MetricsAwareDatumWriter<?> metricsAwareDatumWriter = null;
+ private org.apache.iceberg.Schema icebergSchema;
+ private MetricsConfig metricsConfig;
private long numRecords = 0L;
+ private boolean isClosed = false;
- AvroFileAppender(Schema schema, OutputFile file,
- Function<Schema, DatumWriter<?>> createWriterFunc,
+ AvroFileAppender(org.apache.iceberg.Schema icebergSchema, Schema schema,
OutputFile file,
Review comment:
I think here I'm adding iceberg schema to the constructor, in addition
to an avro `Schema`, so we need to fully qualify one of them. The reason to add
the iceberg schema is to avoid converting Avro schema back to Iceberg one when
using it to evaluating metrics modes, but I guess we can directly input Iceberg
schema in constructor and let constructor to do the conversion to Avro schema.
Do you have a recommendation?
----------------------------------------------------------------
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]