umehrot2 commented on a change in pull request #1953:
URL: https://github.com/apache/hudi/pull/1953#discussion_r476840436



##########
File path: hudi-common/src/main/java/org/apache/hudi/avro/HoodieAvroUtils.java
##########
@@ -433,23 +434,46 @@ private static Object 
convertValueForSpecificDataTypes(Schema fieldSchema, Objec
       return fieldValue;
     }
 
-    if (isLogicalTypeDate(fieldSchema)) {
-      return LocalDate.ofEpochDay(Long.parseLong(fieldValue.toString()));
+    if (fieldSchema.getType() == Schema.Type.UNION) {
+      for (Schema schema : fieldSchema.getTypes()) {
+        if (schema.getType() != Schema.Type.NULL) {

Review comment:
       Do we need to check this explicitly ? `convertValueForAvroLogicalTypes` 
will either ways just return the field value in this case.
   
   The check is either ways not being performed in case Schema type is not 
`UNION`. It might be okay to remove this.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to