You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2021/10/21 06:01:23 UTC

[GitHub] [hudi] yanghua commented on a change in pull request #3837: [HUDI-2592] Fix write empty array when write.precombine.field is decimal type

yanghua commented on a change in pull request #3837:
URL: https://github.com/apache/hudi/pull/3837#discussion_r733343080



##########
File path: hudi-common/src/main/java/org/apache/hudi/avro/HoodieAvroUtils.java
##########
@@ -546,8 +546,11 @@ private static Object convertValueForAvroLogicalTypes(Schema fieldSchema, Object
         return decimalConversion.fromFixed((GenericFixed) fieldValue, fieldSchema,
             LogicalTypes.decimal(dc.getPrecision(), dc.getScale()));
       } else if (fieldSchema.getType() == Schema.Type.BYTES) {
-        return decimalConversion.fromBytes((ByteBuffer) fieldValue, fieldSchema,
-            LogicalTypes.decimal(dc.getPrecision(), dc.getScale()));
+        ByteBuffer byteBuffer = (ByteBuffer) fieldValue;
+        BigDecimal convertedValue = decimalConversion.fromBytes((ByteBuffer) fieldValue, fieldSchema,

Review comment:
       can we replace `(ByteBuffer) fieldValue` to be the defined variable `byteBuffer `?




-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org