xtern commented on code in PR #3229:
URL: https://github.com/apache/ignite-3/pull/3229#discussion_r1497596912


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/exp/ExpressionFactoryImpl.java:
##########
@@ -316,6 +318,11 @@ public Iterable<RowT> values(List<RexLiteral> values, 
RelDataType rowType) {
                 RexLiteral literal = values.get(i);
                 Object val = literal.getValueAs(types.get(field));
 
+                // Literal was parsed as UTC timestamp, now we need to adjust 
it to the client's time zone.
+                if (val != null && literal.getTypeName() == 
SqlTypeName.TIMESTAMP_WITH_LOCAL_TIME_ZONE) {
+                    val = IgniteSqlFunctions.localTimestampToUtc((Long) val, 
(TimeZone) ctx.get(Variable.TIME_ZONE.camelName));

Review Comment:
   The value was already boxed)
   
   Changed this casting to `long` for clarity.



##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/util/IgniteMethod.java:
##########
@@ -72,6 +73,9 @@ public enum IgniteMethod {
 
     STRING_TO_TIMESTAMP(IgniteSqlFunctions.class, "timestampStringToNumeric", 
String.class),
 
+    /** See {@link IgniteSqlFunctions#localTimestampToUtc(Long, TimeZone)}. **/
+    LOCAL_TIMESTAMP_TO_UTC(IgniteSqlFunctions.class, "localTimestampToUtc", 
Long.class, TimeZone.class),

Review Comment:
   Fixed, thanks.



-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to