yashmayya commented on code in PR #14782:
URL: https://github.com/apache/pinot/pull/14782#discussion_r1908283932
##########
pinot-query-planner/src/main/java/org/apache/pinot/calcite/sql/fun/PinotOperatorTable.java:
##########
@@ -69,6 +72,30 @@ public static PinotOperatorTable instance() {
return INSTANCE.get();
}
+ // The standard Calcite + and - operators don't support operations on
TIMESTAMP types. However, Pinot supports these
+ // operations, so we need to define our own operators. Note that Postgres
supports - on TIMESTAMP types, but not +.
+ // Calcite only supports such operations if the second operand is an
interval (similar to Postgres for the +
+ // operator).
+ public static final SqlBinaryOperator PINOT_PLUS =
Review Comment:
That works for `ADD` / `SUB`, but not for `+` / `-` since those are unique
operators. We get an error like this during query compilation (sample query -
`SELECT ts - CAST(1234567890 AS TIMESTAMP) from airlineStats LIMIT 1;`) if we
try to register `+` / `-` as Pinot scalar functions -
```
Invalid number of arguments to function '-'. Was expecting 2 arguments
```
--
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]