Class ReplaceStatsFilteredAggWithEval

All Implemented Interfaces:
OptimizerRules.CoordinatorOnly, OptimizerRules.LocalAware<LogicalPlan>

public class ReplaceStatsFilteredAggWithEval extends OptimizerRules.OptimizerRule<LogicalPlan> implements OptimizerRules.CoordinatorOnly
Replaces an aggregation function having a false/null filter with an EVAL node.
     ... | STATS/INLINE STATS x = someAgg(y) WHERE FALSE {BY z} | ...
     =>
     ... | STATS/INLINE STATS x = someAgg(y) {BY z} > | EVAL x = NULL | KEEP x{, z} | ...
 
This rule is applied to both STATS' Aggregate and InlineJoin right-hand side Aggregate plans. The logic is common for both, but the handling of the InlineJoin is slightly different when it comes to pruning its right-hand side Aggregate. Skipped in local optimizer: once a fragment contains an Agg, this can no longer be pruned, which the rule can do