xiarixiaoyao commented on code in PR #7173:
URL: https://github.com/apache/hudi/pull/7173#discussion_r1152859075
##########
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:
This has a significant impact on performance,
Let's avoid using reflection every iteration。
Let's do the same thing as HiveUtils
--
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]