[
https://issues.apache.org/jira/browse/PARQUET-1410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17630481#comment-17630481
]
ASF GitHub Bot commented on PARQUET-1410:
-----------------------------------------
wzx140 commented on code in PR #520:
URL: https://github.com/apache/parquet-mr/pull/520#discussion_r1016760195
##########
parquet-avro/src/main/java/org/apache/parquet/avro/AvroSchemaConverter.java:
##########
@@ -301,17 +308,17 @@ public Schema
convertFIXED_LEN_BYTE_ARRAY(PrimitiveTypeName primitiveTypeName) {
}
@Override
public Schema convertBINARY(PrimitiveTypeName primitiveTypeName) {
- if (annotation == OriginalType.UTF8 || annotation ==
OriginalType.ENUM) {
+ if (annotation instanceof
LogicalTypeAnnotation.StringLogicalTypeAnnotation ||
+ annotation instanceof
LogicalTypeAnnotation.EnumLogicalTypeAnnotation) {
return Schema.create(Schema.Type.STRING);
} else {
return Schema.create(Schema.Type.BYTES);
}
}
});
- LogicalType logicalType = convertOriginalType(
- annotation, asPrimitive.getDecimalMetadata());
- if (logicalType != null && (annotation != DECIMAL ||
+ LogicalType logicalType = convertLogicalType(annotation);
+ if (logicalType != null && (!(annotation instanceof
LogicalTypeAnnotation.DecimalLogicalTypeAnnotation) ||
Review Comment:
@gszadovszky Cloud you please explain why skip DecimalLogicalTypeAnnotation
here. Parquet could store int32/int64 as decimal. I don't understand this.
> Refactor modules to use the new logical type API
> ------------------------------------------------
>
> Key: PARQUET-1410
> URL: https://issues.apache.org/jira/browse/PARQUET-1410
> Project: Parquet
> Issue Type: Improvement
> Components: parquet-mr
> Reporter: Nándor Kollár
> Assignee: Nándor Kollár
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.11.0
>
>
> Refactor parquet-mr modules to use the new logical type API for internal
> decisions (e.g.: replace the OriginalType-based switch cases to a more
> flexible solution, for example in type builder when checking if the proper
> annotation is present on physical type)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)