[
https://issues.apache.org/jira/browse/CALCITE-6480?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17866770#comment-17866770
]
kate commented on CALCITE-6480:
-------------------------------
[~nobigo] That's a good idea, my original thought was to join the predicates in
case when with and/or.
origin query:
{code:java}
WHERE CASE WHEN a.EMPNO > 10 THEN a.ENAME ='HR' WHEN a.EMPNO > 20 THEN a.ENAME
= 'Sales' ELSE a.ENAME = 'Leader';{code}
if we use predicate with and/or, it will be
That is, we will connect all preceding when with case and when predicates with
and
{code:java}
WHERE (a.EMPNO > 10 AND a.ENAME ='HR')
OR (NOT(a.EMPNO > 10) AND a.EMPNO > 20 AND a.ENAME = 'Sales' )
OR (NOT(a.EMPNO > 10) AND NOT(a.EMPNO > 20) AND a.ENAME = 'Leader'){code}
if we use case when = 1 else 0,i don’t sure how to convert
> OracleDialect does not support CASE WHEN returning boolean
> ----------------------------------------------------------
>
> Key: CALCITE-6480
> URL: https://issues.apache.org/jira/browse/CALCITE-6480
> Project: Calcite
> Issue Type: Wish
> Components: core
> Reporter: kate
> Priority: Minor
>
> Our requirement is to use Calcite to translate queries into different
> dialects. During validation in the TPC-DS scenario, we found that {{Oracle}}
> does not support SQL statements like
> {code:java}
> SELECT * FROM xxx
> WHERE CASE WHEN a > 10 THEN b < 5 ELSE c > 0 END;{code}
> Therefore, we hope to remove such predicates at the dialect like Oracle.
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)