Jackie-Jiang commented on code in PR #10841:
URL: https://github.com/apache/pinot/pull/10841#discussion_r1218709548
##########
pinot-common/src/main/java/org/apache/pinot/common/function/scalar/DateTimeFunctions.java:
##########
@@ -642,4 +1138,30 @@ public static long timestampDiff(String unit, long
timestamp1, long timestamp2)
ISOChronology chronology = ISOChronology.getInstanceUTC();
return DateTimeUtils.getTimestampField(chronology,
unit).getDifferenceAsLong(timestamp2, timestamp1);
}
+ @ScalarFunction(names = {"timestampDiffMVMV", "dateDiffMVMV"})
+ public static long[] timestampDiffMVMV(String unit, long[] timestamp1,
long[] timestamp2) {
+ assert timestamp1.length == timestamp2.length;
Review Comment:
Don't use assert here as it won't be executed in production. We should
explicitly check and throw exception if the length doesn't match
##########
pinot-common/src/main/java/org/apache/pinot/common/function/scalar/DateTimeFunctions.java:
##########
@@ -642,4 +1138,30 @@ public static long timestampDiff(String unit, long
timestamp1, long timestamp2)
ISOChronology chronology = ISOChronology.getInstanceUTC();
return DateTimeUtils.getTimestampField(chronology,
unit).getDifferenceAsLong(timestamp2, timestamp1);
}
+ @ScalarFunction(names = {"timestampDiffMVMV", "dateDiffMVMV"})
+ public static long[] timestampDiffMVMV(String unit, long[] timestamp1,
long[] timestamp2) {
Review Comment:
We should revisit these method names, they are kind of confusing now
##########
pinot-common/src/main/java/org/apache/pinot/common/function/scalar/DateTimeFunctions.java:
##########
@@ -78,6 +78,14 @@ private DateTimeFunctions() {
public static long toEpochSeconds(long millis) {
return TimeUnit.MILLISECONDS.toSeconds(millis);
}
+ @ScalarFunction
Review Comment:
(minor) Please add an empty line between methods, same for other places
--
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]