You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "xicm (via GitHub)" <gi...@apache.org> on 2023/03/31 07:11:18 UTC

[GitHub] [hudi] xicm commented on a diff in pull request #7173: [HUDI-5189] Make HiveAvroSerializer compatible with hive3

xicm commented on code in PR #7173:
URL: https://github.com/apache/hudi/pull/7173#discussion_r1154096830


##########
hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/utils/HiveAvroSerializer.java:
##########
@@ -299,14 +296,26 @@ private Object serializePrimitive(PrimitiveObjectInspector fieldOI, Object struc
         String string = (String)fieldOI.getPrimitiveJavaObject(structFieldData);
         return new Utf8(string);
       case DATE:
-        return DateWritable.dateToDays(((DateObjectInspector)fieldOI).getPrimitiveJavaObject(structFieldData));
+        try {
+          Class<?> clazz = structFieldData.getClass();
+          return  clazz.getMethod("getDays").invoke(structFieldData);

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

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