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

[jira] [Comment Edited] (CALCITE-2722) SqlImplementor createLeftCall method throws StackOverflowError

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

Julian Hyde edited comment on CALCITE-2722 at 2/16/19 4:59 PM:
---------------------------------------------------------------

I think you’ve changed the behavior. The previous code builds a tree that is right-deep, but your code builds a tree that is left-deep.  This will change the semantics if the operator is not associative. Can you change your code to build right-deep?

Also, it’s worth commenting in the code why you are avoiding recursion. 


was (Author: julianhyde):
I think you’ve changed the behavior. The previous code builds a tree that is right-deep, but your code builds a tree that is left-deep.  This will change the semantics if the operator is not associative. 

> SqlImplementor createLeftCall method throws StackOverflowError
> --------------------------------------------------------------
>
>                 Key: CALCITE-2722
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2722
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: Mykola Zerniuk
>            Assignee: Julian Hyde
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> SqlImplementor _createLeftCall_ method is implemented using recursion. In this case if sql has a lot of AND or OR operators it throws StackOverflowError.
> {code:java}
> Caused by: java.lang.StackOverflowError
> at org.apache.calcite.util.Util.skipLast(Util.java:1940)
> at org.apache.calcite.util.Util.skipLast(Util.java:1935)
> at org.apache.calcite.rel.rel2sql.SqlImplementor$Context.createLeftCall(SqlImplementor.java:763)
> at org.apache.calcite.rel.rel2sql.SqlImplementor$Context.createLeftCall(SqlImplementor.java:765)
> at org.apache.calcite.rel.rel2sql.SqlImplementor$Context.createLeftCall(SqlImplementor.java:765){code}
> Since calcite converts IN list to OR this bug is also reproduces on huge IN list.



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