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

SqlImplementor createLeftCall method throws StackOverflowError

    XMLWordPrintableJSON

    Details

      Description

      SqlImplementor createLeftCall method is implemented using recursion. In this case if sql has a lot of AND or OR operators it throws StackOverflowError.

      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)

      Since calcite converts IN list to OR this bug is also reproduces on huge IN list.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Zerniuk Mykola Zerniuk
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h 20m
                1h 20m