You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prepare the Cascades planner for multi-stage planning by enabling property computation on arbitrary expressions (#3321)
This PR prepares the Cascades Planner for multiple planner stages. As
only the last such stage produces `RecordQueryPlan`, we need to remove
every explicit reference to `RecordQueryPlan` from the innards of the
planner. This PR specifically changes the `PropertiesMap` that uses
`RecordQueryPlan` with a generic version that can either use
`RelationalExpression` or `RecordQueryPlan` based on which planner stage
we might be in.
The second big change concerns the way properties are maintained and how
state management works for visitors that are used by properties.
Currently, there are properties which can be computed on plans only and
others which can be computed on any kind of expression. There were also
differences in how properties managed their state between different
properties. The following changes were made:
1. properties are singletons (or multitons; enumerated singletons)
2. properties can create a visitor using `createVisitor()`
3. all properties use visitors that work on all kinds of expressions
4. properties that are not meaningful for all kinds of expressions
(plans vs all expressions) can refuse to return a proper result for
those (by throwing a `RecordCoreException`)
5. see `SimpleExpressionVisitor` and
`ExpressionProperty.toExpressionVisitor(..)` for details on how to
transform a plan visitor to a generic expression visitor and how to
transform an old-style simplistic expression visitor.
6. previous classes called `...Property` are not properties anymore if
they cannot be expressed using 1. and 2. Those _properties_ have been
demoted to visitors
Copy file name to clipboardExpand all lines: fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/combinatorics/TopologicalSort.java
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -730,6 +730,10 @@ public static <T> Optional<List<T>> anyTopologicalOrderPermutation(@Nonnull fina
730
730
* @return a permutation of the set that is topologically correctly ordered with respect to {@code dependsOnFn}
Copy file name to clipboardExpand all lines: fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/RecordQueryPlanComplexityException.java
Copy file name to clipboardExpand all lines: fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/RecordQueryPlannerConfiguration.java
Copy file name to clipboardExpand all lines: fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/CascadesCostModel.java
Copy file name to clipboardExpand all lines: fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades/CascadesPlanner.java
0 commit comments