Class PlannerUtils
java.lang.Object
org.elasticsearch.xpack.esql.planner.PlannerUtils
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordResult of local plan optimization containing both physical and logical plans.static interfacestatic final recordstatic enumstatic final recordThe plan here is used as a fallback if the reduce driver cannot be planned in a way that avoids field extraction after TopN. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BlockFactoryDeprecated, for removal: This API element is subject to removal in a future version. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.elasticsearch.core.Tuple<PhysicalPlan, PhysicalPlan> breakPlanBetweenCoordinatorAndDataNode(PhysicalPlan plan, Configuration config) static org.elasticsearch.core.Tuple<List<PhysicalPlan>, PhysicalPlan> When the plan contains children likeMergeExecresulted from the planning of commands such as FORK, we need to break the plan into sub plans and a main coordinator plan.static QueryBuildercanMatchFilter(EsqlFlags flags, Configuration configuration, TransportVersion minTransportVersion, PhysicalPlan plan) Extracts a filter that can be used to skip unmatched shards on the coordinator.static voidforEachRelation(PhysicalPlan plan, Consumer<EsRelation> action) static booleanhasLimitedInput(LogicalPlan plan) Checks that the input rows of the plan have been reduced by LIMIT.static PhysicalPlanintegrateEsFilterIntoFragment(PhysicalPlan plan, QueryBuilder esFilter) static PhysicalPlanlocalPlan(PhysicalPlan plan, LocalLogicalPlanOptimizer logicalOptimizer, LocalPhysicalPlanOptimizer physicalOptimizer, PlanTimeProfile planTimeProfile) static PhysicalPlanlocalPlan(PhysicalPlan plan, LocalLogicalPlanOptimizer logicalOptimizer, LocalPhysicalPlanOptimizer physicalOptimizer, PlanTimeProfile planTimeProfile, Consumer<LogicalPlan> onLogicalPlanOptimized) static PhysicalPlanlocalPlan(PlannerSettings plannerSettings, EsqlFlags flags, List<SearchExecutionContext> searchContexts, Configuration configuration, FoldContext foldCtx, PhysicalPlan plan, PlanTimeProfile planTimeProfile) static PhysicalPlanlocalPlan(PlannerSettings plannerSettings, EsqlFlags flags, Configuration configuration, FoldContext foldCtx, PhysicalPlan plan, SearchStats searchStats, PlanTimeProfile planTimeProfile) static PhysicalPlanlocalPlan(PlannerSettings plannerSettings, EsqlFlags flags, Configuration configuration, FoldContext foldCtx, PhysicalPlan plan, SearchStats searchStats, FilterPushdownRegistry filterPushdownRegistry, PlanTimeProfile planTimeProfile) static PhysicalPlanlocalPlan(PlannerSettings plannerSettings, EsqlFlags flags, Configuration configuration, FoldContext foldCtx, PhysicalPlan plan, SearchStats searchStats, FilterPushdownRegistry filterPushdownRegistry, FormatReaderRegistry formatReaderRegistry, PlanTimeProfile planTimeProfile) static PlannerUtils.LocalPlanResultlocalPlanWithLogical(PhysicalPlan plan, LocalLogicalPlanOptimizer logicalOptimizer, LocalPhysicalPlanOptimizer physicalOptimizer, PlanTimeProfile planTimeProfile) static PlannerUtils.LocalPlanResultlocalPlanWithLogical(PlannerSettings plannerSettings, EsqlFlags flags, List<SearchExecutionContext> searchContexts, Configuration configuration, FoldContext foldCtx, PhysicalPlan plan, PlanTimeProfile planTimeProfile) static PlannerUtils.LocalPlanResultlocalPlanWithLogical(PlannerSettings plannerSettings, EsqlFlags flags, Configuration configuration, FoldContext foldCtx, PhysicalPlan plan, SearchStats searchStats, PlanTimeProfile planTimeProfile) static PlannerUtils.PlanReductionreductionPlan(PhysicalPlan plan) static ElementTypetoElementType(DataType dataType) Map QL'sDataTypeto the compute engine'sElementType.static ElementTypetoElementType(DataType dataType, MappedFieldType.FieldExtractPreference fieldExtractPreference) Map QL'sDataTypeto the compute engine'sElementType.static ElementTypetoSortableElementType(DataType dataType) Map QL'sDataTypeto the compute engine'sElementType, for sortable types only.static booleanusesScoring(QueryPlan<?> plan)
-
Field Details
-
NON_BREAKING_BLOCK_FACTORY
Deprecated, for removal: This API element is subject to removal in a future version.A non-breaking block factory used to create small pages during the planning TODO: Remove this
-
-
Constructor Details
-
PlannerUtils
public PlannerUtils()
-
-
Method Details
-
breakPlanIntoSubPlansAndMainPlan
public static org.elasticsearch.core.Tuple<List<PhysicalPlan>,PhysicalPlan> breakPlanIntoSubPlansAndMainPlan(PhysicalPlan plan) When the plan contains children likeMergeExecresulted from the planning of commands such as FORK, we need to break the plan into sub plans and a main coordinator plan. The result pages from each sub plan will be funneled to the main coordinator plan. To achieve this, we wire each sub plan with aExchangeSinkExecand add aExchangeSourceExecto the main coordinator plan. There is an additional split of each sub plan into a data node plan and coordinator plan. This split is not done here, but as part ofPlannerUtils#breakPlanBetweenCoordinatorAndDataNode. -
breakPlanBetweenCoordinatorAndDataNode
public static org.elasticsearch.core.Tuple<PhysicalPlan,PhysicalPlan> breakPlanBetweenCoordinatorAndDataNode(PhysicalPlan plan, Configuration config) -
reductionPlan
-
forEachRelation
-
localPlanWithLogical
public static PlannerUtils.LocalPlanResult localPlanWithLogical(PlannerSettings plannerSettings, EsqlFlags flags, List<SearchExecutionContext> searchContexts, Configuration configuration, FoldContext foldCtx, PhysicalPlan plan, PlanTimeProfile planTimeProfile) -
localPlanWithLogical
public static PlannerUtils.LocalPlanResult localPlanWithLogical(PlannerSettings plannerSettings, EsqlFlags flags, Configuration configuration, FoldContext foldCtx, PhysicalPlan plan, SearchStats searchStats, PlanTimeProfile planTimeProfile) -
localPlanWithLogical
public static PlannerUtils.LocalPlanResult localPlanWithLogical(PhysicalPlan plan, LocalLogicalPlanOptimizer logicalOptimizer, LocalPhysicalPlanOptimizer physicalOptimizer, PlanTimeProfile planTimeProfile) -
localPlan
public static PhysicalPlan localPlan(PlannerSettings plannerSettings, EsqlFlags flags, List<SearchExecutionContext> searchContexts, Configuration configuration, FoldContext foldCtx, PhysicalPlan plan, PlanTimeProfile planTimeProfile) -
localPlan
public static PhysicalPlan localPlan(PlannerSettings plannerSettings, EsqlFlags flags, Configuration configuration, FoldContext foldCtx, PhysicalPlan plan, SearchStats searchStats, PlanTimeProfile planTimeProfile) -
localPlan
public static PhysicalPlan localPlan(PlannerSettings plannerSettings, EsqlFlags flags, Configuration configuration, FoldContext foldCtx, PhysicalPlan plan, SearchStats searchStats, FilterPushdownRegistry filterPushdownRegistry, PlanTimeProfile planTimeProfile) -
localPlan
public static PhysicalPlan localPlan(PlannerSettings plannerSettings, EsqlFlags flags, Configuration configuration, FoldContext foldCtx, PhysicalPlan plan, SearchStats searchStats, FilterPushdownRegistry filterPushdownRegistry, FormatReaderRegistry formatReaderRegistry, PlanTimeProfile planTimeProfile) -
integrateEsFilterIntoFragment
public static PhysicalPlan integrateEsFilterIntoFragment(PhysicalPlan plan, @Nullable QueryBuilder esFilter) -
localPlan
public static PhysicalPlan localPlan(PhysicalPlan plan, LocalLogicalPlanOptimizer logicalOptimizer, LocalPhysicalPlanOptimizer physicalOptimizer, PlanTimeProfile planTimeProfile) -
localPlan
public static PhysicalPlan localPlan(PhysicalPlan plan, LocalLogicalPlanOptimizer logicalOptimizer, LocalPhysicalPlanOptimizer physicalOptimizer, PlanTimeProfile planTimeProfile, @Nullable Consumer<LogicalPlan> onLogicalPlanOptimized) -
canMatchFilter
public static QueryBuilder canMatchFilter(EsqlFlags flags, Configuration configuration, TransportVersion minTransportVersion, PhysicalPlan plan) Extracts a filter that can be used to skip unmatched shards on the coordinator. -
toSortableElementType
Map QL'sDataTypeto the compute engine'sElementType, for sortable types only. This specifically excludes spatial data types, which are not themselves sortable. -
toElementType
Map QL'sDataTypeto the compute engine'sElementType. -
toElementType
public static ElementType toElementType(DataType dataType, MappedFieldType.FieldExtractPreference fieldExtractPreference) Map QL'sDataTypeto the compute engine'sElementType. Under some situations, the same data type might be extracted into a different element type. For example, spatial types can be extracted into doc-values under specific conditions, otherwise they extract as BytesRef. -
usesScoring
-
hasLimitedInput
Checks that the input rows of the plan have been reduced by LIMIT. In the case where non-unary plans are used, such asForkorUnionAll, we check that the rows from each branch are reduced by LIMIT.
-