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

Vladimir Sitnikov commented on CALCITE-2451:
--------------------------------------------

{quote}"x < NULL" was a 2-deep tree, now we match "(x < NULL) IS TRUE" which is 
a 3-deep tree{quote}
Matching does not seem to be of a complicated problem to me.

What bothers me is cases like {{(x=2) AND (y=1)}} (assume x,y are nullable)

{{// AND(x, y) IS TRUE ==> x IS TRUE and y IS TRUE}}

{{isTrue( (x=2) AND (y=1) )}} ==> {{isTrue(x=2) AND isTrue(y=1)}}
If we stop here, the final expression turned out to me more complicated than 
the original one (basically we added two isTrue nodes for little reasons).

We can unwrap like {{isTrue(x=2) AND isTrue(y=1)}}  ==> {{isNotNull(x\) AND x=2 
AND isNotNull(y\) AND y=1}}, however that is not much better than the original 
code.


> RexSimplify: fuse unknownAsFalse and IS TRUE handling
> -----------------------------------------------------
>
>                 Key: CALCITE-2451
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2451
>             Project: Calcite
>          Issue Type: Sub-task
>          Components: core
>    Affects Versions: 1.17.0
>            Reporter: Vladimir Sitnikov
>            Assignee: Julian Hyde
>            Priority: Major
>
> It looks like {{unknownAsFalse}} duplicates {{IS_TRUE}} handling.
> In other words, {{withUnknownAsFalse(true). simplfy(expr)}} is more or less 
> comparable to {{simplify(isTrue(expr))}}
> Implementing {{IS_TRUE/IS_FALSE/...}} simplification possibilities might make 
> {{unknownAsFalse}} obsolete.



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

Reply via email to