AvroFileAppender(Schema schema, OutputFile file, Function<Schema, DatumWriter<?>> createWriterFunc, CodecFactory codec, Map<String, String> metadata) throws IOException { this.writer = newAvroWriter(schema, file, createWriterFunc, codec, metadata); }
public <D> FileAppender<D> build() throws IOException { Preconditions.checkNotNull(schema, "Schema is required"); Preconditions.checkNotNull(name, "Table name is required and cannot be null"); // add the Iceberg schema to keyValueMetadata meta("iceberg.schema", SchemaParser.toJson(schema)); return new AvroFileAppender<>( AvroSchemaUtil.convert(schema, name), file, createWriterFunc, codec(), metadata); } }