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

Zoltan Haindrich commented on CALCITE-2555:
-------------------------------------------

It's great that the patch also addresses {{null > f\(x\)}} cases as well!

But I would like to note that I think there might be some issue with the 
current patch because it calls {{simplify_}} from {{simplifyStrong()}}
 * every node in the tree will be probably visited at least twice after this 
change; because simplifyStrong will run an extra visit on the child nodes - and 
the simplifyX method which supposed to simplify it, will do another run...which 
will result in {{2**depth}} visits on every node
 ** this problem kinda takes me back to my earlier idea: that somehow visited 
nodes should be tracked...because as we make it more more smarter; the 
performance will eventually degrade...tracking would easily handle this problem 
as well
 * I didn't know about the Strong (I really like it by the way) - but I don't 
think its needed in this case: I feel that adding some logic to 
{{simplifyComparision}} would be better; because there is already a strategic 
pattern in this class...the {{simpifyStrong()}} call I think a little bit 
breaks that pattern.

> RexSimplify: >=(true, null) could be simplified to null
> -------------------------------------------------------
>
>                 Key: CALCITE-2555
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2555
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.17.0
>            Reporter: Vladimir Sitnikov
>            Assignee: Julian Hyde
>            Priority: Major
>              Labels: newbie
>
> {code:java}
> @Test public void simplifyComparisonWithNull() {
>   checkSimplify2(ge(trueLiteral, falseLiteral), "true", "true");
>   checkSimplify2(ge(trueLiteral, nullBool), "null", "false");
>   checkSimplify2(ge(nullBool, nullBool), "null", "false");
> }
> {code}



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

Reply via email to