Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-3869

Stackoverflow with large OR statements

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.22.0
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None

      Description

      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:

      @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();
      }

       

      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.

        Attachments

        1. stackoverflow.txt
          82 kB
          Stephan Pirnbaum

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              stephan.pirnbaum Stephan Pirnbaum
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: