Package | Description |
---|---|
org.apache.drill.exec.planner.index | |
org.apache.drill.exec.planner.index.generators |
Modifier and Type | Class and Description |
---|---|
class |
MapRDBFunctionalIndexInfo |
Modifier and Type | Method and Description |
---|---|
FunctionalIndexInfo |
DrillIndexDescriptor.getFunctionalInfo() |
FunctionalIndexInfo |
IndexDescriptor.getFunctionalInfo()
Get the functional index information associated with this index (Functional indexes are
indexes involving expressions e.g CAST(a as INT).
|
FunctionalIndexInfo |
MapRDBIndexDescriptor.getFunctionalInfo() |
Modifier and Type | Method and Description |
---|---|
static org.apache.calcite.rel.RelCollation |
IndexPlanUtils.buildCollationLowerProject(List<org.apache.calcite.rex.RexNode> projectRexs,
org.apache.calcite.rel.RelNode input,
FunctionalIndexInfo indexInfo)
Build collation property for the 'lower' project, the one closer to the Scan
|
static org.apache.calcite.rel.RelCollation |
IndexPlanUtils.buildCollationProject(List<org.apache.calcite.rex.RexNode> projectRexs,
DrillProjectRelBase project,
org.apache.calcite.rel.RelNode input,
FunctionalIndexInfo indexInfo,
IndexCallContext context)
Build collation property for project, the one closer to the Scan
|
static org.apache.calcite.rel.RelCollation |
IndexPlanUtils.buildCollationUpperProject(List<org.apache.calcite.rex.RexNode> projectRexs,
org.apache.calcite.rel.RelCollation inputCollation,
FunctionalIndexInfo indexInfo,
Map<Integer,List<org.apache.calcite.rex.RexNode>> collationFilterMap)
Build collation property for the 'upper' project, the one above the filter
|
static org.apache.calcite.rex.RexNode |
FunctionalIndexHelper.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) |
static org.apache.calcite.rel.type.RelDataType |
FunctionalIndexHelper.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.
|
static boolean |
IndexPlanUtils.isCoveringIndex(IndexCallContext indexContext,
FunctionalIndexInfo functionInfo)
For a particular table scan for table T1 and an index on that table, find out if it is a covering index
|
static org.apache.calcite.rex.RexNode |
IndexPlanUtils.rewriteFunctionalRex(IndexCallContext indexContext,
DrillParseContext parseContext,
DrillProjectRelBase project,
org.apache.calcite.rel.RelNode scan,
org.apache.calcite.rex.RexNode toRewriteRex,
org.apache.calcite.rel.type.RelDataType newRowType,
FunctionalIndexInfo functionInfo)
A RexNode forest with three RexNodes for expressions "cast(a.q as int) * 2, b+c, concat(a.q, " world")"
on Scan RowType('a', 'b', 'c') will be like this:
(0)Call:"*" Call:"concat"
/ \ / \
(1)Call:CAST 2 Call:"+" (5)Call:ITEM ' world'
/ \ / \ / \
(2)Call:ITEM TYPE:INT (3)$1 (4)$2 $0 'q'
/ \
$0 'q'
So for above expressions, when visiting the RexNode trees using PathInExpr, we could mark indexed expressions in the trees,
as shown in the diagram above are the node (1),
then collect the schema paths in the indexed expression but found out of the indexed expression -- node (5),
and other regular schema paths (3) (4)
|
static org.apache.calcite.rel.type.RelDataType |
FunctionalIndexHelper.rewriteFunctionalRowType(org.apache.calcite.rel.RelNode origScan,
IndexCallContext indexContext,
FunctionalIndexInfo functionInfo) |
static org.apache.calcite.rel.type.RelDataType |
FunctionalIndexHelper.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"
|
static List<SchemaPath> |
IndexPlanUtils.rewriteFunctionColumn(List<SchemaPath> paths,
FunctionalIndexInfo functionInfo,
List<SchemaPath> addedPaths)
For IndexGroupScan, if a column is only appeared in the should-be-renamed function,
this column is to-be-replaced column, we replace that column(schemaPath) from 'a.b'
to '$1' in the list of SchemaPath.
|
Modifier and Type | Field and Description |
---|---|
protected FunctionalIndexInfo |
CoveringIndexPlanGenerator.functionInfo |
protected FunctionalIndexInfo |
CoveringPlanNoFilterGenerator.functionInfo |
protected FunctionalIndexInfo |
NonCoveringIndexPlanGenerator.functionInfo |
Constructor and Description |
---|
CoveringIndexPlanGenerator(IndexLogicalPlanCallContext indexContext,
FunctionalIndexInfo functionInfo,
IndexGroupScan indexGroupScan,
org.apache.calcite.rex.RexNode indexCondition,
org.apache.calcite.rex.RexNode remainderCondition,
org.apache.calcite.rex.RexBuilder builder,
PlannerSettings settings) |
CoveringPlanNoFilterGenerator(IndexCallContext indexContext,
FunctionalIndexInfo functionInfo,
boolean isSingleton,
PlannerSettings settings) |
Copyright © 1970 The Apache Software Foundation. All rights reserved.