tkalkirill commented on code in PR #13569:
URL: https://github.com/apache/ignite/pull/13569#discussion_r4024743969


##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/util/TypeUtils.java:
##########
@@ -435,15 +464,15 @@ public static Object fromInternal(DataContext ctx, Object 
val, Type storageType)
         else if (storageType == java.sql.Date.class && val instanceof Integer)
             return new java.sql.Date(fromLocalTs(ctx, (Integer)val * 
DateTimeUtils.MILLIS_PER_DAY));
         else if (storageType == LocalDate.class && val instanceof Integer)
-            return new java.sql.Date(fromLocalTs(ctx, (Integer)val * 
DateTimeUtils.MILLIS_PER_DAY)).toLocalDate();
+            return LocalDate.ofEpochDay((Integer)val);

Review Comment:
   I checked both variants. Keeping direct Local* conversions in both 
directions makes the DST tests pass without cutover handling. Fixing only 
fromInternal still leaves failures in dynamic parameters and UDF/UDTF results.
   However, without cutover handling, converting SQL DATE 1500-01-02 to 
java.sql.Date produces 1499-12-24. I reproduced this with the base-branch 
implementation too.
   Should we limit this change to direct Local* conversions and address 
historical java.sql.* dates separately, or preserve those calendar dates in 
this PR as well?
   Or what suggestions do you have?



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