in parquet-protobuf/src/main/java/org/apache/parquet/proto/ProtoWriteSupport.java [313:365]
private FieldWriter createMessageWriter(FieldDescriptor fieldDescriptor, Type type) {
if (fieldDescriptor.isMapField() && writeSpecsCompliant) {
return createMapWriter(fieldDescriptor, type);
}
if (unwrapProtoWrappers) {
Descriptor messageType = fieldDescriptor.getMessageType();
if (messageType.equals(Timestamp.getDescriptor())) {
return new TimestampWriter();
}
if (messageType.equals(Date.getDescriptor())) {
return new DateWriter();
}
if (messageType.equals(TimeOfDay.getDescriptor())) {
return new TimeWriter();
}
if (messageType.equals(DoubleValue.getDescriptor())) {
return new DoubleValueWriter();
}
if (messageType.equals(FloatValue.getDescriptor())) {
return new FloatValueWriter();
}
if (messageType.equals(Int64Value.getDescriptor())) {
return new Int64ValueWriter();
}
if (messageType.equals(UInt64Value.getDescriptor())) {
return new UInt64ValueWriter();
}
if (messageType.equals(Int32Value.getDescriptor())) {
return new Int32ValueWriter();
}
if (messageType.equals(UInt32Value.getDescriptor())) {
return new UInt32ValueWriter();
}
if (messageType.equals(BoolValue.getDescriptor())) {
return new BoolValueWriter();
}
if (messageType.equals(StringValue.getDescriptor())) {
return new StringValueWriter();
}
if (messageType.equals(BytesValue.getDescriptor())) {
return new BytesValueWriter();
}
}
// This can happen now that recursive schemas get truncated to bytes. Write the bytes.
if (type.isPrimitive()
&& type.asPrimitiveType().getPrimitiveTypeName() == PrimitiveType.PrimitiveTypeName.BINARY) {
return new BinaryWriter();
}
return new MessageWriter(fieldDescriptor.getMessageType(), getGroupType(type));
}