use of org.apache.parquet.format.ConvertedType in project drill by apache.
the class ParquetToDrillTypeConverter method toMajorType.
public static TypeProtos.MajorType toMajorType(PrimitiveType.PrimitiveTypeName primitiveTypeName, int length, TypeProtos.DataMode mode, SchemaElement schemaElement, OptionManager options) {
ConvertedType convertedType = schemaElement.getConverted_type();
MinorType minorType = getMinorType(primitiveTypeName, length, convertedType, options);
TypeProtos.MajorType.Builder typeBuilder = TypeProtos.MajorType.newBuilder().setMinorType(minorType).setMode(mode);
if (Types.isDecimalType(minorType)) {
int precision = schemaElement.getPrecision();
int scale = schemaElement.getScale();
typeBuilder.setPrecision(precision).setScale(scale);
}
return typeBuilder.build();
}
Aggregations