use of org.apache.parquet.arrow.schema.SchemaMapping.RepeatedTypeMapping in project parquet-mr by apache.
the class SchemaConverter method fromParquet.
/**
* @param type parquet type
* @param name overrides parquet.getName)
* @param repetition overrides parquet.getRepetition()
* @return
*/
private TypeMapping fromParquet(Type type, String name, Repetition repetition) {
if (repetition == REPEATED) {
// case where we have a repeated field that is not in a List/Map
TypeMapping child = fromParquet(type, null, REQUIRED);
Field arrowField = new Field(name, false, new ArrowType.List(), asList(child.getArrowField()));
return new RepeatedTypeMapping(arrowField, type, child);
}
if (type.isPrimitive()) {
return fromParquetPrimitive(type.asPrimitiveType(), name);
} else {
return fromParquetGroup(type.asGroupType(), name);
}
}
Aggregations