yashmayya opened a new pull request, #14782: URL: https://github.com/apache/pinot/pull/14782
- Prior to https://github.com/apache/pinot/pull/14089, the `ADD` and `SUB` scalar functions in Pinot were not aliased to the Calcite standard operators `+` / `-`. This meant that the scalar function definition was used and that allowed for things like `SUB(ts_col1, ts_col2)` or `ADD(ts_col1, ts_literal)`. - However, things like `ts_col1 - ts_col2` or `ts_col1 + ts_col2` were still not allowed since the Calcite standard operators only support these operand types - numeric and numeric, datetime types and intervals, or intervals and intervals (see [here](https://github.com/apache/calcite/blob/129e5cc89cafa0d55e3d4c1925ca7cafee888bdd/core/src/main/java/org/apache/calcite/sql/type/OperandTypes.java#L1251-L1273)). This led to an inconsistent experience with Pinot's operators. Also, note that Postgres supports directly subtracting timestamp types (but only adding timestamps to intervals). - This patch fixes the above regression with `ADD` and `SUB`. Also, since Pinot uses long types for timestamps internally and we support such operations in the single-stage engine, this patch also adds support for timestamp types with `+` and `-` in the multi-stage engine. -- 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]
