Class IndexConditionInfo.Builder

java.lang.Object
org.apache.drill.exec.planner.index.IndexConditionInfo.Builder
Enclosing class:
IndexConditionInfo

public static class IndexConditionInfo.Builder extends Object
  • 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

      public IndexConditionInfo getCollectiveInfo(IndexLogicalPlanCallContext indexContext)
      Get a single IndexConditionInfo in which indexCondition has field on all indexes in this.indexes
      Returns:
    • isValidIndexHint

      public boolean isValidIndexHint(IndexLogicalPlanCallContext indexContext)
    • getFirstKeyIndexConditionMap

      public Map<IndexDescriptor,IndexConditionInfo> 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 indexIndexDescriptor and condition IndexConditionInfo 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 indexIndexDescriptor and condition IndexConditionInfo pairs
    • getIndexConditionMap

      public Map<IndexDescriptor,IndexConditionInfo> 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 indexIndexDescriptor and condition IndexConditionInfo 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: