Class IndexConditionInfo.Builder
java.lang.Object
org.apache.drill.exec.planner.index.IndexConditionInfo.Builder
- Enclosing class:
- IndexConditionInfo
-
Constructor Summary
ConstructorDescriptionBuilder
(org.apache.calcite.rex.RexNode condition, Iterable<IndexDescriptor> indexes, org.apache.calcite.rex.RexBuilder builder, org.apache.calcite.rel.RelNode scan) Builder
(org.apache.calcite.rex.RexNode condition, IndexDescriptor index, org.apache.calcite.rex.RexBuilder builder, DrillScanRel scan) -
Method Summary
Modifier and TypeMethodDescriptiongetCollectiveInfo
(IndexLogicalPlanCallContext indexContext) Get a single IndexConditionInfo in which indexCondition has field on all indexes in this.indexesGet a map of Index=>IndexConditionInfo, each IndexConditionInfo has the separated condition and remainder condition.Get a map of Index=>IndexConditionInfo, each IndexConditionInfo has the separated condition and remainder condition.getIndexConditionMap
(List<IndexDescriptor> indexList) Get a map of Index=>IndexConditionInfo, each IndexConditionInfo has the separated condition and remainder condition.indexConditionRelatedToFields
(List<LogicalExpression> relevantPaths, org.apache.calcite.rex.RexNode condition) Given a list of Index Expressions(usually indexed fields/functions from one or a set of indexes), separate a filter condition into 1), relevant subset of conditions (by relevant, it means at least one given index Expression was found) and, 2), the rest in remainderConditionboolean
isConditionPrefix
(IndexDescriptor indexDesc, org.apache.calcite.rex.RexNode initCondition) Given a RexNode corresponding to the condition expression tree and the index descriptor, check if one or more columns involved in the condition tree form a prefix of the columns in the index keys.boolean
isValidIndexHint
(IndexLogicalPlanCallContext indexContext)
-
Constructor Details
-
Builder
public Builder(org.apache.calcite.rex.RexNode condition, Iterable<IndexDescriptor> indexes, org.apache.calcite.rex.RexBuilder builder, org.apache.calcite.rel.RelNode scan) -
Builder
public Builder(org.apache.calcite.rex.RexNode condition, IndexDescriptor index, org.apache.calcite.rex.RexBuilder builder, DrillScanRel scan)
-
-
Method Details
-
getCollectiveInfo
Get a single IndexConditionInfo in which indexCondition has field on all indexes in this.indexes- Returns:
-
isValidIndexHint
-
getFirstKeyIndexConditionMap
Get a map of Index=>IndexConditionInfo, each IndexConditionInfo has the separated condition and remainder condition. The map is ordered, so the last IndexDescriptor will have the final remainderCondition after separating conditions that are relevant to this.indexes. The conditions are separated on LEADING index columns.- Returns:
- Map containing index
IndexDescriptor
and conditionIndexConditionInfo
pairs
-
isConditionPrefix
public boolean isConditionPrefix(IndexDescriptor indexDesc, org.apache.calcite.rex.RexNode initCondition) Given a RexNode corresponding to the condition expression tree and the index descriptor, check if one or more columns involved in the condition tree form a prefix of the columns in the index keys.- Parameters:
indexDesc
-initCondition
-- Returns:
- True if prefix, False if not
-
getIndexConditionMap
public Map<IndexDescriptor,IndexConditionInfo> getIndexConditionMap(List<IndexDescriptor> indexList) Get a map of Index=>IndexConditionInfo, each IndexConditionInfo has the separated condition and remainder condition. The map is ordered, so the last IndexDescriptor will have the final remainderCondition after separating conditions that are relevant to the indexList. The conditions are separated based on index columns.- Returns:
- Map containing index
IndexDescriptor
and conditionIndexConditionInfo
pairs
-
getIndexConditionMap
Get a map of Index=>IndexConditionInfo, each IndexConditionInfo has the separated condition and remainder condition. The map is ordered, so the last IndexDescriptor will have the final remainderCondition after separating conditions that are relevant to this.indexes. The conditions are separated based on index columns.- Returns:
- Map containing index
IndexDescriptor
and conditionIndexConditionInfo
pairs
-
indexConditionRelatedToFields
public IndexConditionInfo indexConditionRelatedToFields(List<LogicalExpression> relevantPaths, org.apache.calcite.rex.RexNode condition) Given a list of Index Expressions(usually indexed fields/functions from one or a set of indexes), separate a filter condition into 1), relevant subset of conditions (by relevant, it means at least one given index Expression was found) and, 2), the rest in remainderCondition- Parameters:
relevantPaths
-condition
-- Returns:
-