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); } }