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

Stack overflow error thrown when running join query

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.22.0
    • Component/s: None

      Description

      A unit test in our project is failing which is as below.

      The query in question is 

      SELECT * FROM tblspace1.t1 t10, tblspace1.t2 t20 WHERE t20.n1 = 3 AND t10.n1 = 3 AND t20.n1 = t10.n1

      I get a stack overflow error- 

      -- Mid Plan-- Mid Plan
      LogicalProject(subset=[rel#19:Subset#4.ENUMERABLE.[]], k1=[$0], n1=[$1], s1=[$2], k2=[$3], n10=[$4], s2=[$5])
        LogicalFilter(subset=[rel#16:Subset#3.NONE.[]], condition=[AND(=($4, 3), =($1, 3), =($4, $1))])
          LogicalJoin(subset=[rel#14:Subset#2.NONE.[]], condition=[true], joinType=[inner])
            EnumerableTableScan(subset=[rel#11:Subset#0.ENUMERABLE.[]], table=[[tblspace1, t1]])
            EnumerableTableScan(subset=[rel#12:Subset#1.ENUMERABLE.[]], table=[[tblspace1, t2]])
      
      java.lang.StackOverflowError at 
      org.apache.calcite.plan.volcano.RelSubset$CheapestPlanReplacer.visit(RelSubset.java:639) at org.apache.calcite.plan.volcano.RelSubset$CheapestPlanReplacer.visit(RelSubset.java:643) at org.apache.calcite.plan.volcano.RelSubset$CheapestPlanReplacer.visit(RelSubset.java:643) at org.apache.calcite.plan.volcano.RelSubset$CheapestPlanReplacer.visit(RelSubset.java:643) at org.apache.calcite.plan.volcano.RelSubset$CheapestPlanReplacer.visit(RelSubset.java:643) at org.apache.calcite.plan.volcano.RelSubset$CheapestPlanReplacer.visit(RelSubset.java:643)
      

      Also attaching the UT code in the ticket

        Attachments

        1. TestCalcite.java
          8 kB
          Amit Chavan
        2. IMG_5089.jpg
          2.51 MB
          Xiening Dai

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                achavan1@gmail.com Amit Chavan
              • Votes:
                0 Vote for this issue
                Watchers:
                8 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 10m
                  1h 10m