You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Jesus Camacho Rodriguez (JIRA)" <ji...@apache.org> on 2018/10/17 20:34:00 UTC
[jira] [Comment Edited] (CALCITE-1413) New CASE statement
simplification
[ https://issues.apache.org/jira/browse/CALCITE-1413?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16654156#comment-16654156 ]
Jesus Camacho Rodriguez edited comment on CALCITE-1413 at 10/17/18 8:33 PM:
----------------------------------------------------------------------------
Fixed in [b470a0c|http://git-wip-us.apache.org/repos/asf/calcite/commit/b470a0c]. Thanks [~kgyrtkirk]!
was (Author: jcamachorodriguez):
Fixed in [b470a0c|http://git-wip-us.apache.org/repos/asf/calcite/commit/b470a0c].
> New CASE statement simplification
> ---------------------------------
>
> Key: CALCITE-1413
> URL: https://issues.apache.org/jira/browse/CALCITE-1413
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Affects Versions: 1.9.0
> Reporter: Jesus Camacho Rodriguez
> Assignee: Zoltan Haindrich
> Priority: Major
> Fix For: 1.18.0
>
>
> Another possible simplification for CASE statements that return boolean values.
> {code:sql}
> CASE
> WHEN p1 THEN e1
> WHEN p2 THEN e2
> ELSE TRUE
> END
> {code}
> where e1...en are boolean expressions, can be rewritten into:
> {code:sql}
> (p1 and e1) or (p2 and e2 and not(p1)) or (not(p1) and not(p2))
> {code}
> if p1...pn cannot be nullable.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)