Search in sources :

Example 1 with PigMetaData

use of org.apache.parquet.pig.PigMetaData in project parquet-mr by apache.

the class AbstractThriftWriteSupport method init.

protected void init(Class<T> thriftClass) {
    this.thriftClass = thriftClass;
    this.thriftStruct = getThriftStruct();
    this.schema = ThriftSchemaConverter.convertWithoutProjection(thriftStruct);
    final Map<String, String> extraMetaData = new ThriftMetaData(thriftClass.getName(), thriftStruct).toExtraMetaData();
    // TODO: make this work for non-tbase types
    if (isPigLoaded() && TBase.class.isAssignableFrom(thriftClass)) {
        new PigMetaData(new ThriftToPig((Class<? extends TBase<?, ?>>) thriftClass).toSchema()).addToMetaData(extraMetaData);
    }
    this.writeContext = new WriteContext(schema, extraMetaData);
}
Also used : ThriftMetaData(org.apache.parquet.thrift.ThriftMetaData) PigMetaData(org.apache.parquet.pig.PigMetaData) TBase(org.apache.thrift.TBase) ThriftToPig(com.twitter.elephantbird.pig.util.ThriftToPig)

Aggregations

ThriftToPig (com.twitter.elephantbird.pig.util.ThriftToPig)1 PigMetaData (org.apache.parquet.pig.PigMetaData)1 ThriftMetaData (org.apache.parquet.thrift.ThriftMetaData)1 TBase (org.apache.thrift.TBase)1