Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
Docs Required, Release Notes Required
Description
SQL function TIMESTAMPDIFF returns INTEGER type for MICROSECOND time unit, but sometimes precession of int is not enough to store value. For example, value for
SELECT TIMESTAMPDIFF(MICROSECOND, TIMESTAMP '2022-02-01 10:30:26.000', TIMESTAMP '2022-05-01 10:30:28.122')
is 7689602122000, and it's more then maximum int value. It's better to extend TIMESTAMPDIFF return type to BIGINT for MICROSECOND time unit (SqlTimestampDiffFunction.RETURN_TYPE_INFERENCE should be changed).
The main problem - this function is defined in Calcite and hardcoded in the parser (see TimestampDiffFunctionCall in Parser.jj), so it's not so easy to provide our own implementation.
Attachments
Issue Links
- is part of
-
IGNITE-19162 Sql. Trim all less than millisecond information from timestamp.
- Open
-
IGNITE-14535 Caclite SQL engine capabilities
- Open