[
https://issues.apache.org/jira/browse/CALCITE-2767?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Kevin Risden reassigned CALCITE-2767:
-------------------------------------
Assignee: Benoit Hanotte
> Invalid operands for Case operator in RexSqlStandardConvertletTable
> -------------------------------------------------------------------
>
> Key: CALCITE-2767
> URL: https://issues.apache.org/jira/browse/CALCITE-2767
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.18.0
> Reporter: Benoit Hanotte
> Assignee: Benoit Hanotte
> Priority: Minor
> Fix For: 1.20.0
>
>
> `SqlCaseOperator.createCall()` requires 4 operands [1]:
> # first value (i.e. CASE value WHEN...)
> # when condifitions (as SqlNodeList)
> # then values (as SqlNodeLists)
> # else value
> `RexSqlStandardConvertletTable` always only pass 3 arguments [2] as it uses
> the generic form such as
> {code:java}
> CASE WHEN condition1 THEN val2 ... ELSE val3 END{code}
> and never the form
> {code:java}
> CASE val WHEN condition1 THEN val2 ELSE val3{code}
> When calling `SqlCaseOperator.createCall()`, it needs to pass a null sql node
> for the first value in order to correctly provide the 4 expected arguments
> and not only the last 3.
> [1]
> [https://github.com/apache/calcite/blob/59b76701d9c805f51b0929577ca604fdbfe00b0b/core/src/main/java/org/apache/calcite/sql/fun/SqlCaseOperator.java#L288]
> [2]
> [https://github.com/apache/calcite/blob/59b76701d9c805f51b0929577ca604fdbfe00b0b/core/src/main/java/org/apache/calcite/rex/RexSqlStandardConvertletTable.java#L239]
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)