Check if there any cartesian products between joins of any type in the optimized plan tree.
This class defines the cost model for a plan.
Cost-based join reorder.
Speeds up aggregates on fixed-precision decimals by executing them on unscaled Long values.
Elimination of outer joins, if the predicates can restrict the result sets so that all null-supplying rows are eliminated
Replaces the expression of CurrentDatabase with the current database name.
Generate a list of additional filters from an operator's existing constraint but remove those that are either already part of the operator's condition or are part of the operator's child constraints.
Helper class that keeps information about the join graph as sets of item/plan ids.
Pushes down LocalLimit beneath UNION ALL and beneath the streamed inputs of outer joins.
Replaces Expressions that can be statically evaluated with equivalent Literal values.
Optimizes expressions by replacing according to CodeGen configuration.
Optimize IN predicates: 1.
Abstract class all optimizers should inherit of, contains the standard batches (extending Optimizers can override this.
This is a mimic class for a join node that has been ordered.
Removes filters that can be evaluated trivially.
Reorder the joins and push all the conditions into join, so that the bottom ones have at least one condition.
Encapsulates star-schema detection logic.
Simplifies boolean expressions: 1.
Combines two adjacent Project operators into one and perform alias substitution, merging the expressions into one single expression.
Combines adjacent RepartitionOperation operators
Collapse Adjacent Window Expression.
Attempts to eliminate the reading of unneeded columns from the query plan.
Combines two adjacent Filter operators into one, merging the non-redundant conditions into one conjunctive predicate.
Combines two adjacent Limit operators into one, merging the expressions into one single expression.
Combines two adjacent TypedFilters, which operate on same type object in condition, into one, merging the filter functions into one conjunctive function.
Combines all adjacent Union operators into a single Union.
Computes the current date and time to make sure we return the same result in a single query.
Replaces Expressions that can be statically evaluated with equivalent Literal values.
Converts local operations (i.
Removes MapObjects when the following conditions are satisfied
Removes cases where we are unnecessarily going between the object and serialized (InternalRow) representation of data item.
Removes no-op SortOrder from Sort
Propagate foldable expressions: Replace attributes with aliases of the original foldable expressions if possible.
Reorder the joins using a dynamic programming algorithm.
Implements optional filters to reduce the search space for join enumeration.
Simplifies LIKE expressions that do not need full regular expressions to evaluate the condition.
Collapse plans consisting empty local relations generated by PruneFilters.
Pull out all (outer) correlated predicates from a given subquery.
Pushes Filter operators through many operators iff: 1) the operator is deterministic 2) the predicate is deterministic and the operator will not change any of rows.
Pushes down Filter operators where the condition
can be
evaluated using only the attributes of the left or right side of a join.
Pushes Project operator to both sides of a Union operator.
Removes nodes that are not necessary.
Removes literals from group expressions in Aggregate, as they have no effect to the result but only makes the grouping key bigger.
Remove redundant aliases from a query plan.
Remove projections from the query plan that do not make any modifications.
Removes repetition from group expressions in Aggregate, as they have no effect to the result but only makes the grouping key bigger.
Reorder associative integral-type operators and fold all constants into one.
Replaces logical Deduplicate operator with an Aggregate operator.
Replaces logical Distinct operator with an Aggregate operator.
Replaces logical Except operator with a left-anti Join operator.
Finds all RuntimeReplaceable expressions and replace them with the expressions that can be evaluated.
Replaces logical Intersect operator with a left-semi Join operator.
This rule rewrites correlated ScalarSubquery expressions into LEFT OUTER joins.
This rule rewrites an aggregate query with distinct aggregations into an expanded double aggregation in which the regular aggregation expressions and every distinct clause is aggregated in a separate group.
This rule rewrites predicate sub-queries into left semi/anti joins.
An optimizer used in test code.
Simplifies binary comparisons with semantically-equal expressions: 1) Replace '<=>' with 'true' literal.
Removes the inner case conversion expressions that are unnecessary because the inner conversion is overwritten by the outer one.
Removes Casts that are unnecessary because the input is already the correct type.
Simplifies conditional expressions (if / case).
push down operations into CreateArray.
push down operations into CreateMap.
push down operations into CreateNamedStructLike.