nsivabalan commented on code in PR #14076:
URL: https://github.com/apache/hudi/pull/14076#discussion_r2437354340


##########
hudi-utilities/src/test/java/org/apache/hudi/utilities/sources/helpers/TestMercifulJsonToRowConverterBase.java:
##########
@@ -320,10 +314,20 @@ void dateLogicalTypeTest(String groundTruthRow, Object 
dateInput) throws IOExcep
     if (groundTruthRow == null) {
       return;
     }
-    Row rec = 
RowFactory.create(java.sql.Date.valueOf(groundTruthRow).toLocalDate());
-    Row realRow = CONVERTER.convertToRow(json, schema);
+    Row rec;
+    if (isJava8ApiEnabled()) {
+      rec = 
RowFactory.create(java.sql.Date.valueOf(groundTruthRow).toLocalDate());

Review Comment:
   So, we are returning either of `LocalDate` or `Date` based on the java8 api 
usage right. 
   then, if user moves the pipelines from java 8 to java 11, wouldn't we have 
data inconsistency issues? 
   can you help clarify 



##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/helpers/MercifulJsonToRowConverter.java:
##########
@@ -275,8 +278,7 @@ public Pair<Boolean, Object> handleStringValue(String 
value) {
           },
           value, schema);
       if (result.getLeft()) {
-        // timestamp in spark sql doesn't support precision to the micro.
-        return Pair.of(true, new Timestamp(((Long) result.getRight()) / 1000));
+        return Pair.of(true, DateTimeUtils.microsToInstant((Long) 
result.getRight()));

Review Comment:
   So, by moving from 'Timestamp` to `Instant`, we can now support both millis 
and micros in spark?  
   atleast for json to row conversions.
   



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

Reply via email to