Search in sources :

Example 1 with ThriftWriteSupport

use of org.apache.parquet.hadoop.thrift.ThriftWriteSupport in project parquet-mr by apache.

the class TupleToThriftWriteSupport method init.

@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public WriteContext init(Configuration configuration) {
    try {
        Class<?> clazz = configuration.getClassByName(className).asSubclass(TBase.class);
        thriftWriteSupport = new ThriftWriteSupport(clazz);
        pigToThrift = new PigToThrift(clazz);
        return thriftWriteSupport.init(configuration);
    } catch (ClassNotFoundException e) {
        throw new BadConfigurationException("The thrift class name was not found: " + className, e);
    } catch (ClassCastException e) {
        throw new BadConfigurationException("The thrift class name should extend TBase: " + className, e);
    }
}
Also used : ThriftWriteSupport(org.apache.parquet.hadoop.thrift.ThriftWriteSupport) BadConfigurationException(org.apache.parquet.hadoop.BadConfigurationException) PigToThrift(com.twitter.elephantbird.pig.util.PigToThrift)

Aggregations

PigToThrift (com.twitter.elephantbird.pig.util.PigToThrift)1 BadConfigurationException (org.apache.parquet.hadoop.BadConfigurationException)1 ThriftWriteSupport (org.apache.parquet.hadoop.thrift.ThriftWriteSupport)1