You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Zoltan Haindrich (JIRA)" <ji...@apache.org> on 2019/02/14 23:37:00 UTC

[jira] [Created] (CALCITE-2848) Simplifying a case statement's first branch should disregard its safety

Zoltan Haindrich created CALCITE-2848:
-----------------------------------------

             Summary: Simplifying a case statement's first branch should disregard its safety
                 Key: CALCITE-2848
                 URL: https://issues.apache.org/jira/browse/CALCITE-2848
             Project: Calcite
          Issue Type: Improvement
            Reporter: Zoltan Haindrich
            Assignee: Zoltan Haindrich


Example: a very simple CASE which is not get rewritten because the first condition branch contains an unknown UDF
{code:sql}
CASE
 WHEN to_date('2001-11-11') = '2000' THEN true
 ELSE false
END
{code}

This expression right now retained as is; because the "to_date" was an unknown UDF; but since the first branch of a CASE is always evaluated and that could unlock the rewrite of this case to it's boolean form.




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)