linliu-code commented on code in PR #17601:
URL: https://github.com/apache/hudi/pull/17601#discussion_r2742773296
##########
hudi-common/src/main/java/org/apache/hudi/avro/HoodieAvroUtils.java:
##########
@@ -1436,4 +1474,107 @@ public static Comparable<?>
unwrapAvroValueWrapper(Object avroValueWrapper) {
}
}
+ /**
+ * Checks if a logical type is an instance of LocalTimestampMillis using
reflection.
+ * Returns false if the class doesn't exist (e.g., in Avro 1.8.2).
+ */
+ private static boolean isLocalTimestampMillis(LogicalType logicalType) {
+ if (logicalType == null) {
+ return false;
+ }
+ try {
+ Class<?> localTimestampMillisClass =
Class.forName("org.apache.avro.LogicalTypes$LocalTimestampMillis");
Review Comment:
Fixed. Now the reflection will only happen once.
--
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]