Class FunctionalIndexHelper
java.lang.Object
org.apache.drill.exec.planner.index.FunctionalIndexHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.calcite.rex.RexNodeconvertConditionForIndexScan(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) static org.apache.calcite.rel.type.RelDataTypeconvertRowTypeForIndexScan(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.static org.apache.calcite.rel.type.RelDataTyperewriteFunctionalRowType(org.apache.calcite.rel.RelNode origScan, IndexCallContext indexContext, FunctionalIndexInfo functionInfo) static org.apache.calcite.rel.type.RelDataTyperewriteFunctionalRowType(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"
-
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 rewrittenindexContext- the index plan contextfunctionInfo- 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.invalid input: '<'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 scanidxScan-- 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)
-