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

Support SQL hints for temporal table join

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.30.0
    • core

    Description

      Background

      Like hint on join, sometimes we need hint on temporal table join. For example, specify USE_HASH hint on temporal table join like the following sql,

      select /*+ USE_HASH (orders) */  stream * from orders join products_temporal
      for system_time as of orders.rowtime on orders.productid = products_temporal.productid
      

      Now, above sql would translate into correlate instead of Join, like the following Tree Node.

      LogicalDelta
        LogicalProject(ROWTIME=[$0], PRODUCTID=[$1], ORDERID=[$2], PRODUCTID0=[$3], NAME=[$4], SUPPLIERID=[$5], SYS_START=[$6], SYS_END=[$7])
          LogicalFilter(condition=[=($1, $3)])
            LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{0}])
              LogicalTableScan(table=[[CATALOG, SALES, ORDERS]])
              LogicalSnapshot(period=[$cor0.ROWTIME])
                LogicalTableScan(table=[[CATALOG, SALES, PRODUCTS_TEMPORAL]])
      

      However, correlate is not a hintable node now and the hint could not be propagated to the correlate nodes.
      So I wonder could we extend correlate to be a hintable node?

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jingzhang Jing Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              5 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 - 2h
                  2h