Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.36.0
Description
Currently the LeadLag operator does not use the default value when inferring the type of a column.
For the following example:
SELECT lead(c * 2, 1, -1.4) OVER (PARTITION BY x ORDER BY c) FROM t
The column 'c' has type INTEGER, and Calcite infers a type of INTEGER for the result. However, the default value for the lead is -1.4, which is DECIMAL, so the result type should be DECIMAL.
Currently Calcite only uses the nullability of the default value, but not its type in the result type inference.
Attachments
Issue Links
- links to