vaibhav-sinha commented on a change in pull request #2923:
URL: https://github.com/apache/hudi/pull/2923#discussion_r646699355



##########
File path: 
hudi-flink/src/main/java/org/apache/hudi/util/StringToRowDataConverter.java
##########
@@ -85,7 +87,8 @@ private static Converter getConverter(LogicalType 
logicalType) {
         // see HoodieAvroUtils#convertValueForAvroLogicalTypes
         return field -> (int) LocalDate.parse(field).toEpochDay();
       case TIMESTAMP_WITHOUT_TIME_ZONE:
-        return field -> TimestampData.fromEpochMillis(Long.parseLong(field));
+        // see HoodieAvroUtils#convertValueForAvroLogicalTypes
+        return field -> 
TimestampData.fromEpochMillis(LocalDateTime.parse(field).atZone(ZoneId.systemDefault()).toInstant().toEpochMilli());

Review comment:
       Yes it is related to this patch. In HoodieAvroUtils, whenever the 
LogicalType is timestamp, LocalDateTime instance is being returned instead of 
Long. Hence in string form, we would get a DateTime string in 
StringToRowConverter instead of stringified Long as before. Hence it needs to 
be parsed using LocalDateTime parser. Check the handling of LocalDate in the 
line above which was there from before because LogicalType date was handled 
correctly in HoodieAvroUtils before only.




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