[
https://issues.apache.org/jira/browse/CALCITE-6382?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mihai Budiu resolved CALCITE-6382.
----------------------------------
Fix Version/s: 1.38.0
Resolution: Fixed
Fixed in
https://github.com/apache/calcite/commit/f854ef5ee480e0ff893b18d27ec67dc381ee2244
> Type inference for SqlLeadLagAggFunction is incorrect
> -----------------------------------------------------
>
> Key: CALCITE-6382
> URL: https://issues.apache.org/jira/browse/CALCITE-6382
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.36.0
> Reporter: Mihai Budiu
> Priority: Minor
> Labels: pull-request-available
> Fix For: 1.38.0
>
>
> Currently the LeadLag operator does not use the default value when inferring
> the type of a column.
> For the following example:
> {code:java}
> SELECT lead(c * 2, 1, -1.4) OVER (PARTITION BY x ORDER BY c) FROM t
> {code}
> 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.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)