tanclary commented on code in PR #3631: URL: https://github.com/apache/calcite/pull/3631#discussion_r1457868807
########## core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java: ########## @@ -4461,6 +4461,51 @@ public static int time(long timestampMillis, String timeZone) { / (1000L * 1000L)); // milli > micro > nano } + /** SQL {@code TO_TIMESTAMP_LTZ(date)} function + * for a date values. */ + public static long toTimestampLtzDate(int days) { + return timestamp(days); + } + + /** SQL {@code TO_TIMESTAMP_LTZ(timestampSeconds)} + * function for long values. */ + public static long toTimestampLtz(long timestampSeconds) { + return toTimestampLtz(timestampSeconds, 0); + } + + /** SQL {@code TO_TIMESTAMP_LTZ(timestampSeconds)} function + * for BigDecimal values. */ + public static long toTimestampLtz(BigDecimal timestampSeconds) { + return toTimestampLtz(timestampSeconds.longValue(), 0); + } + + /** SQL {@code TO_TIMESTAMP_LTZ(timestampSeconds, scale)} + * function for BigDecimal values with a specified scale. */ + public static long toTimestampLtz(BigDecimal timestampSeconds, int scale) { + return toTimestampLtz(timestampSeconds.longValue(), scale); + } + + /** SQL {@code TO_TIMESTAMP_LTZ(timestampSeconds, scale)} + * function for long values with a specified scale. */ Review Comment: Added a longer comment that explains the `scale` parameter better. Added an example too. Let me know what you think. -- 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: commits-unsubscr...@calcite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org