Interface PlannerGraphRewritable
-
- All Known Subinterfaces:
RecordQueryPlan
,RecordQueryPlanWithChild
,RecordQueryPlanWithChildren
,RecordQueryPlanWithComparisons
,RecordQueryPlanWithIndex
,RecordQueryPlanWithNoChildren
,RecordQueryPlanWithRequiredFields
- All Known Implementing Classes:
ComposedBitmapIndexQueryPlan
,FullUnorderedScanExpression
,LogicalFilterExpression
,LogicalTypeFilterExpression
,RecordQueryCoveringIndexPlan
,RecordQueryFetchFromPartialRecordPlan
,RecordQueryFilterPlan
,RecordQueryIndexPlan
,RecordQueryInJoinPlan
,RecordQueryInParameterJoinPlan
,RecordQueryIntersectionPlan
,RecordQueryInValuesJoinPlan
,RecordQueryLoadByKeysPlan
,RecordQueryPredicateFilterPlan
,RecordQueryScanPlan
,RecordQueryScoreForRankPlan
,RecordQueryTextIndexPlan
,RecordQueryTypeFilterPlan
,RecordQueryUnionPlan
,RecordQueryUnionPlanBase
,RecordQueryUnorderedDistinctPlan
,RecordQueryUnorderedPrimaryKeyDistinctPlan
,RecordQueryUnorderedUnionPlan
public interface PlannerGraphRewritable
Interface to allowRelationalExpression
s to rewrite their own graph representation. This interface allows aRelationalExpression
to create/modify low level planner graph structures while a planner graph is created through an expression walk inPlannerGraphProperty
. Such a rewrite can be useful if the standard representation is confusing, misleading, or just too complicated. For instance,RecordQueryPlanWithIndex
additionally creates a separate node underneath the actual plan operator to show the index as a record producer. The nature of the rewrite is highly operator-specific, therefore, the rewrite is not part of the visitor or some other common logic. Expressions that decide to implement this interface must then implementrewritePlannerGraph(java.util.List<? extends com.apple.foundationdb.record.query.plan.temp.explain.PlannerGraph>)
to do the actual rewrite. Implementors of this interface should rewrite the planner graph for both internal show as well as explain purposes. There are two other flavors of this interface: seeInternalPlannerGraphRewritable
andExplainPlannerGraphRewritable
. Those interfaces allow an expression to rewrite only for one of the use cases or differently for either of them. Note that these three interfaces do not form a hierarchy themselves. Also, in order to keep the code from bleeding into general expression structures, we didn't want to have another set of methods onRelationalExpression
. The approach taken here works more like a tag interface that can be chosen by a specific operator to do something very specific without cluttering the general code path.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PlannerGraph
rewritePlannerGraph(List<? extends PlannerGraph> childGraphs)
Method to rewrite the planner graph.
-
-
-
Method Detail
-
rewritePlannerGraph
@Nonnull PlannerGraph rewritePlannerGraph(@Nonnull List<? extends PlannerGraph> childGraphs)
Method to rewrite the planner graph.- Parameters:
childGraphs
- planner graphs of children expression that already have been computed- Returns:
- a new planner graph that can combine the
childGraph
s in a meaningful way. Note that there is no obligation to use thechildGraph
s at all, this method can create a new independent planner graph completely from scratch.
-
-