use of org.apache.parquet.io.GroupColumnIO in project parquet-mr by apache.
the class ParquetWriteProtocol method getProtocol.
private TProtocol getProtocol(ThriftField field, ColumnIO columnIO, Events returnClause) {
TProtocol p;
final ThriftType type = field.getType();
switch(type.getType()) {
case STOP:
case VOID:
default:
throw new UnsupportedOperationException("can't convert type of " + field);
case BOOL:
case BYTE:
case DOUBLE:
case I16:
case I32:
case I64:
case STRING:
p = new PrimitiveWriteProtocol((PrimitiveColumnIO) columnIO, returnClause);
break;
case STRUCT:
p = new StructWriteProtocol((GroupColumnIO) columnIO, (StructType) type, returnClause);
break;
case MAP:
p = new MapWriteProtocol((GroupColumnIO) columnIO, (MapType) type, returnClause);
break;
case SET:
p = new ListWriteProtocol((GroupColumnIO) columnIO, ((SetType) type).getValues(), returnClause);
break;
case LIST:
p = new ListWriteProtocol((GroupColumnIO) columnIO, ((ListType) type).getValues(), returnClause);
break;
case ENUM:
p = new EnumWriteProtocol((PrimitiveColumnIO) columnIO, (EnumType) type, returnClause);
break;
}
return p;
}
Aggregations