SourabhBadhya commented on code in PR #3964:
URL: https://github.com/apache/hive/pull/3964#discussion_r1073502143
##########
ql/src/java/org/apache/hadoop/hive/ql/io/parquet/convert/ETypeConverter.java:
##########
@@ -676,6 +676,39 @@ private int getScale(PrimitiveType type) {
return logicalType.getScale();
}
};
+ case serdeConstants.VARCHAR_TYPE_NAME:
+ return new BinaryConverter<HiveVarcharWritable>(type, parent, index,
hiveTypeInfo) {
+ @Override
+ protected HiveVarcharWritable convert(Binary binary) {
+ DecimalLogicalTypeAnnotation logicalType =
(DecimalLogicalTypeAnnotation) type.getLogicalTypeAnnotation();
+ HiveDecimalWritable decimalWritable =
HiveDecimalUtils.enforcePrecisionScale(
+ new HiveDecimalWritable(binary.getBytes(),
logicalType.getScale()),
+ new DecimalTypeInfo(logicalType.getPrecision(),
logicalType.getScale()));
Review Comment:
Nice way to refactor @kasakrisz . Implemented it in a similar way. Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]