use of org.apache.nifi.processors.parquet.record.AvroParquetHDFSRecordWriter in project nifi by apache.
the class PutParquet method createHDFSRecordWriter.
@Override
public HDFSRecordWriter createHDFSRecordWriter(final ProcessContext context, final FlowFile flowFile, final Configuration conf, final Path path, final RecordSchema schema) throws IOException, SchemaNotFoundException {
final Schema avroSchema = AvroTypeUtil.extractAvroSchema(schema);
final AvroParquetWriter.Builder<GenericRecord> parquetWriter = AvroParquetWriter.<GenericRecord>builder(path).withSchema(avroSchema);
applyCommonConfig(parquetWriter, context, flowFile, conf);
return new AvroParquetHDFSRecordWriter(parquetWriter.build(), avroSchema);
}
Aggregations