siddharthteotia commented on a change in pull request #6719: URL: https://github.com/apache/incubator-pinot/pull/6719#discussion_r620657416
########## File path: pinot-common/src/main/java/org/apache/pinot/common/function/scalar/DateTimeFunctions.java ########## @@ -228,6 +229,22 @@ public static long fromEpochDaysBucket(long days, long bucket) { return TimeUnit.DAYS.toMillis(days * bucket); } + /** + * Converts epoch millis to Timestamp + */ + @ScalarFunction + public static Timestamp toTimestamp(long millis) { + return new Timestamp(millis); + } + + /** + * Converts Timestamp to epoch millis + */ + @ScalarFunction + public static long fromTimestamp(Timestamp timestamp) { Review comment: Also, what about adding other utility functions like adding/subtracting two timestamps. I think users can probably use ADD/SUB non-scalar transform function on TIMESTAMP type but probably this is a better place -- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org