Class FunctionalIndexHelper

java.lang.Object
org.apache.drill.exec.planner.index.FunctionalIndexHelper

public class FunctionalIndexHelper extends Object
  • Constructor Details

    • FunctionalIndexHelper

      public FunctionalIndexHelper()
  • Method Details

    • rewriteFunctionalRowType

      public static org.apache.calcite.rel.type.RelDataType rewriteFunctionalRowType(org.apache.calcite.rel.RelNode origScan, IndexCallContext indexContext, FunctionalIndexInfo functionInfo)
    • rewriteFunctionalRowType

      public static org.apache.calcite.rel.type.RelDataType rewriteFunctionalRowType(org.apache.calcite.rel.RelNode origScan, IndexCallContext indexContext, FunctionalIndexInfo functionInfo, Collection<SchemaPath> addedPaths)
      if a field in rowType serves only the to-be-replaced column(s), we should replace it with new name "$1", otherwise we should keep this dataTypeField and add a new one for "$1"
      Parameters:
      origScan - the original scan whose rowtype is to be rewritten
      indexContext - the index plan context
      functionInfo - functional index information that may impact rewrite
      Returns:
    • convertRowTypeForIndexScan

      public static org.apache.calcite.rel.type.RelDataType convertRowTypeForIndexScan(DrillScanRelBase origScan, IndexableExprMarker idxMarker, IndexGroupScan idxScan, FunctionalIndexInfo functionInfo)
      For IndexScan in non-covering case, rowType to return contains only row_key('_id') of primary table. so the rowType for IndexScan should be converted from [Primary_table.row_key, primary_table.indexed_col] to [indexTable.row_key(primary_table.indexed_col), indexTable.<primary_key.row_key> (Primary_table.row_key)] This will impact the columns of scan, the rowType of ScanRel
      Parameters:
      origScan -
      idxMarker - the IndexableExprMarker that has analyzed original index condition on top of index scan
      idxScan -
      Returns:
    • convertConditionForIndexScan

      public static org.apache.calcite.rex.RexNode convertConditionForIndexScan(org.apache.calcite.rex.RexNode idxCondition, org.apache.calcite.rel.RelNode origScan, org.apache.calcite.rel.type.RelDataType idxRowType, org.apache.calcite.rex.RexBuilder builder, FunctionalIndexInfo functionInfo)