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

`inheritPath` of `RelHint` represented by `ImmutableBitSet` may be incomplete.

    XMLWordPrintableJSON

Details

    • Patch

    Description

      Taking the following SQL with hint for example: (Copying from `org.apache.calcite.test.SqlHintsConverterTest.testQueryHint `)

       

      select /*+ properties(k1='v1', k2='v2'), index(ename), no_hash_join */
      from emp e1 
      inner join dept d1 on e1.deptno = d1.deptno
      inner join emp e2 on e1.ename = e2.job

       

      rel plan with hints should be something like the following according to the hint design doc:

      LogicalProject(...)([PROPERTIES inheritPath:[] options:{K1=v1, K2=v2}],[INDEX inheritPath:[] options:[ENAME]],[NO_HASH_JOIN inheritPath:[]])
        LogicalJoin(...) ([NO_HASH_JOIN inheritPath:[0]])
          LogicalJoin(...) (NO_HASH_JOIN inheritPath:[0, 0]])
            LogicalTableScan(...) ([PROPERTIES inheritPath:[0, 0, 0] options:{K1=v1, K2=v2}], [INDEX inheritPath:[0, 0, 0] options:[ENAME]])
            LogicalTableScan(...) ([PROPERTIES inheritPath:[0, 0, 1] options:{K1=v1, K2=v2}], [INDEX inheritPath:[1, 0, 0] options:[ENAME]])
          LogicalProject(...)
            LogicalTableScan(...) ([PROPERTIES inheritPath:[0, 1, 0] options:{K1=v1, K2=v2}], [INDEX inheritPath:[0, 1, 0] options:[ENAME]])

       

      But the expected result of  `SqlHintsConverterTest.testQueryHint` violates  the intention of Hint design doc.

       

      Attachments

        Issue Links

          Activity

            People

              danny0405 Danny Chen
              icshuo Shuo Cheng
              Votes:
              0 Vote for this issue
              Watchers:
              3 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 - 20m
                  20m