use of org.apache.parquet.thrift.ParquetWriteProtocol in project parquet-mr by apache.
the class ThriftBytesWriteSupport method prepareForWrite.
@Override
public void prepareForWrite(RecordConsumer recordConsumer) {
final MessageColumnIO columnIO = new ColumnIOFactory().getColumnIO(schema);
this.parquetWriteProtocol = new ParquetWriteProtocol(recordConsumer, columnIO, thriftStruct);
thriftWriteSupport.prepareForWrite(recordConsumer);
}
use of org.apache.parquet.thrift.ParquetWriteProtocol in project parquet-mr by apache.
the class TestParquetWriteProtocol method validateThrift.
private void validateThrift(String[] expectations, TBase<?, ?> a) throws TException {
final ThriftSchemaConverter thriftSchemaConverter = new ThriftSchemaConverter();
// System.out.println(a);
final Class<TBase<?, ?>> class1 = (Class<TBase<?, ?>>) a.getClass();
final MessageType schema = thriftSchemaConverter.convert(class1);
LOG.info("{}", schema);
final StructType structType = thriftSchemaConverter.toStructType(class1);
ExpectationValidatingRecordConsumer recordConsumer = new ExpectationValidatingRecordConsumer(new ArrayDeque<String>(Arrays.asList(expectations)));
final MessageColumnIO columnIO = new ColumnIOFactory().getColumnIO(schema);
ParquetWriteProtocol p = new ParquetWriteProtocol(new RecordConsumerLoggingWrapper(recordConsumer), columnIO, structType);
a.write(p);
}
use of org.apache.parquet.thrift.ParquetWriteProtocol in project parquet-mr by apache.
the class AbstractThriftWriteSupport method prepareForWrite.
@Override
public void prepareForWrite(RecordConsumer recordConsumer) {
final MessageColumnIO columnIO = new ColumnIOFactory().getColumnIO(schema);
this.parquetWriteProtocol = new ParquetWriteProtocol(recordConsumer, columnIO, thriftStruct);
}
Aggregations