| Package | Description |
|---|---|
| org.apache.drill.exec.planner.index | |
| org.apache.drill.exec.planner.index.generators |
| Modifier and Type | Class and Description |
|---|---|
class |
IndexLogicalPlanCallContext |
class |
IndexPhysicalPlanCallContext |
| Modifier and Type | Method and Description |
|---|---|
static org.apache.calcite.rel.RelCollation |
IndexPlanUtils.buildCollationCoveringIndexScan(IndexDescriptor indexDesc,
IndexCallContext context)
Build the collation property for index scan
|
static org.apache.calcite.rel.RelCollation |
IndexPlanUtils.buildCollationForExpressions(Map<LogicalExpression,Integer> projectExprs,
IndexDescriptor indexDesc,
IndexCallContext context)
Given index, compute the collations for a list of projected expressions(from Scan's rowType or Project's )
in the context
|
static org.apache.calcite.rel.RelCollation |
IndexPlanUtils.buildCollationNonCoveringIndexScan(IndexDescriptor indexDesc,
org.apache.calcite.rel.type.RelDataType indexScanRowType,
org.apache.calcite.rel.type.RelDataType restrictedScanRowType,
IndexCallContext context) |
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 ScanPrel |
IndexPlanUtils.buildCoveringIndexScan(DrillScanRelBase origScan,
IndexGroupScan indexGroupScan,
IndexCallContext indexContext,
IndexDescriptor indexDesc) |
boolean |
MapRDBStatistics.initialize(org.apache.calcite.rex.RexNode condition,
DrillScanRelBase scanRel,
IndexCallContext context) |
boolean |
Statistics.initialize(org.apache.calcite.rex.RexNode condition,
DrillScanRelBase scanRel,
IndexCallContext context) |
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 void |
IndexPlanUtils.updateSortExpression(IndexCallContext indexContext,
List<org.apache.calcite.rel.RelFieldCollation> coll)
generate logical expressions for sort rexNodes in SortRel, the result is store to IndexPlanCallContext
|
| Constructor and Description |
|---|
IndexSelector(IndexCallContext indexContext)
This constructor is to build selector for no index condition case (no filter)
|
IndexSelector(org.apache.calcite.rex.RexNode indexCondition,
org.apache.calcite.rex.RexNode otherRemainderCondition,
IndexCallContext indexContext,
IndexCollection collection,
org.apache.calcite.rex.RexBuilder rexBuilder,
double totalRows) |
| Modifier and Type | Field and Description |
|---|---|
protected IndexCallContext |
AbstractIndexPlanGenerator.indexContext |
| Modifier and Type | Method and Description |
|---|---|
static org.apache.calcite.rel.RelNode |
AbstractIndexPlanGenerator.getExchange(org.apache.calcite.plan.RelOptCluster cluster,
boolean isSingleton,
boolean isExchangeRequired,
org.apache.calcite.plan.RelTraitSet traits,
DrillDistributionTrait distributionTrait,
IndexCallContext indexContext,
org.apache.calcite.rel.RelNode input) |
static org.apache.calcite.rel.RelNode |
AbstractIndexPlanGenerator.getSortNode(IndexCallContext indexContext,
org.apache.calcite.rel.RelNode newRel,
boolean donotGenerateSort,
boolean isSingleton,
boolean isExchangeRequired) |
| Constructor and Description |
|---|
AbstractIndexPlanGenerator(IndexCallContext indexContext,
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 © 2021 The Apache Software Foundation. All rights reserved.