Jackie-Jiang commented on code in PR #9480:
URL: https://github.com/apache/pinot/pull/9480#discussion_r985162612


##########
pinot-common/src/main/java/org/apache/pinot/common/function/scalar/DateTimeFunctions.java:
##########
@@ -704,4 +707,24 @@ public static long timestampDiff(String unit, long 
timestamp1, long timestamp2)
     ISOChronology chronology = ISOChronology.getInstanceUTC();
     return DateTimeUtils.getTimestampField(chronology, 
unit).getDifferenceAsLong(timestamp2, timestamp1);
   }
+
+  /**
+   * For timestamp with time zone, the internally stored value is always in 
UTC (Universal Coordinated Time,
+   * traditionally known as Greenwich Mean Time, GMT). This method will 
transform that timestamp to a timestamp
+   * that represents the millis since epoch in the specified time zone.
+   *
+   * @return a timestamp that corresponds to the {@code timestampInUTC} at 
{@code timeZone}
+   */
+  @ScalarFunction
+  public static Timestamp atTimeZone(long timestampInUTC, String timeZone) {

Review Comment:
   High level question: millis since epoch should be independent of the time 
zone. I don't think there is a way to represent the time zone within the 
`Timestamp`. To change the time zone, we will need to add the `DateTime` type 
support. For now as a work around, we can potentially use `String` to represent 
the value



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to