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 2020/03/24 16:43:00 UTC

[jira] [Commented] (CALCITE-3869) Stackoverflow with large OR statements

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

Julian Hyde commented on CALCITE-3869:
--------------------------------------

This bug is along the lines of
{quote}Patient: Doctor, it hurts when I bang my head on the wall. What do you suggest?

Doctor: I suggest you don't bang your head on the wall.
{quote}
Don't create left-deep OR trees. Use the fact that OR can have multiple arguments, and create a flat tree. Or use the IN operator.

I am inclined to close as won't-fix.

> Stackoverflow with large OR statements
> --------------------------------------
>
>                 Key: CALCITE-3869
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3869
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.22.0
>            Reporter: Stephan Pirnbaum
>            Priority: Major
>         Attachments: stackoverflow.txt
>
>
> As described in CALCITE-2792 large OR clauses lead to a StackOverflowError. While the ticket was closed with the remark "Resolved in release 1.22.0", the issue originally stated was not (completely) resolved. To reproduce this, I implemented following simple test case:
> {code:java}
> @Test
> public void testLargeOr() {
>   String orClause = IntStream.range(0, 1000).boxed()
>                              .map(i -> "e.\"empid\"=" + i)
>                              .collect(Collectors.joining(" OR "));
>   final String sql = "SELECT * FROM \"hr\".\"emps\" e WHERE " + orClause;
>   CalciteAssert.model(JdbcTest.HR_MODEL)
>       .query(sql)
>       .runs();
> }{code}
>  
> The stackoverflow can be seen in the attached log.
> As also CALCITE-2696 and CALCITE-2630 are not fixed, this is a blocking issue in our current use case.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)