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

Vladimir Sitnikov commented on CALCITE-2555:
--------------------------------------------

[~kgyrtkirk], while I am not quite sure which case would trigger "exponential" 
behavior, the following test seems to take sub-second time in current edition 
of PR 831:

{code:java}    RexNode n = vBool();
    for (int i = 0; i < 1000; i++) {
      n = eq(n, falseLiteral);
    }

    checkSimplify2(n, "no idea", "no idea");
{code}

If I try 10'000, then I get java.lang.StackOverflowError.

That is yet another interesting dimenstion to explore since the cases like 
"a+b+c+d+e+f+g+..." might appear in auto-generated code. However I think it is 
not a reason to stop and/or make PR 831 robust to those kinds of pathological 
expressions.


> 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