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

Join with parameterized LIMIT throws AssertionError "not a literal"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.33.0
    • None

    Description

      A query like the following one

      select T."name", T."valueLeverId", T."type", T."ID", T."parentId" 
      from (
        SELECT VD."id" as ID, VD."name", VD."typeId", VD."type", VD."valueLeverId", VD."valueLever", VD."parentId", VDtoSC."VDtoSC_List"
      	FROM VD 
      	LEFT JOIN VDtoSC 
        	ON VD."id" = VDtoSC."Value_Driver_ID"
      ) AS T
      where T."ID" = ? limit ?
      

      fails with

      findValue:1208, RexLiteral (org.apache.calcite.rex)
      intValue:1183, RexLiteral (org.apache.calcite.rex)
      getMaxRowCount:207, RelMdMaxRowCount (org.apache.calcite.rel.metadata)
      getMaxRowCount_$:-1, GeneratedMetadata_MaxRowCountHandler (org.apache.calcite.rel.metadata.janino)
      getMaxRowCount:-1, GeneratedMetadata_MaxRowCountHandler (org.apache.calcite.rel.metadata.janino)
      getMaxRowCount:277, RelMetadataQuery (org.apache.calcite.rel.metadata)
      alreadySmaller:914, RelMdUtil (org.apache.calcite.rel.metadata)
      checkInputForCollationAndLimit:887, RelMdUtil (org.apache.calcite.rel.metadata)
      onMatch:138, SortJoinTransposeRule (org.apache.calcite.rel.rules)
      onMatch:223, VolcanoRuleCall (org.apache.calcite.plan.volcano)
      drive:59, IterativeRuleDriver (org.apache.calcite.plan.volcano)
      findBestExp:523, VolcanoPlanner (org.apache.calcite.plan.volcano)
      lambda$standard$3:276, Programs (org.apache.calcite.tools)
      run:-1, Programs$$Lambda$2787/0x000000080121f9c0 (org.apache.calcite.tools)
      run:336, Programs$SequenceProgram (org.apache.calcite.tools)
      transform:373, PlannerImpl (org.apache.calcite.prepare)
      

      The 2 tables are located in a schema where joins can't be pushed down.

      See also CALCITE-5048  --

      CALCITE-2061

       

      Attachments

        Issue Links

          Activity

            People

              jiajunbernoulli Jiajun Xie
              kramerul Ulrich Kramer
              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 - 0.5h
                  0.5h