[ 
https://issues.apache.org/jira/browse/CALCITE-993?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15042284#comment-15042284
 ] 

Julian Hyde commented on CALCITE-993:
-------------------------------------

I just realized there's a problem. Suppose that the expression is constant but 
evaluates to null. For example,

{code}SELECT NULLIF(1, 1) AS c FROM t{code}

It is not valid to infer the predicate {{c = NULLIF(1, 1)}}. Only {{c IS NOT 
DISTINCT FROM NULLIF(1, 1)}} is valid. But I bet that we can't use predicates 
based on {{IS NOT DISTINCT FROM}} as widely as we can use {{=}}.

> Predicate Pull up above Project enhancement
> -------------------------------------------
>
>                 Key: CALCITE-993
>                 URL: https://issues.apache.org/jira/browse/CALCITE-993
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.5.0
>            Reporter: Laljo John Pullokkaran
>            Assignee: Laljo John Pullokkaran
>
> Predicate Pull up on Project can also pull up deterministic functions whose 
> arguments are all literals.
> Ex: select r1.x from (select cast('10' as int) as x, y  from r1 where y<10)r1 
> join r2 on r1.x=r2.x;
> Currently deterministic functions involving constants are ignored which 
> results in missed transitive inference.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to