Class HoistOrderByBeforeInlineJoin

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

public final class HoistOrderByBeforeInlineJoin extends OptimizerRules.OptimizerRule<LogicalPlan> implements OptimizerRules.CoordinatorOnly
Pulls "up" an OrderBy node that is not preceded by a "sort breaker" (like LIMIT), but is preceded by an InlineJoin. The INLINE STATS is sort agnostic, so the OrderBy can be pulled up without affecting the semantics of this type of join. This is needed since otherwise the OrderBy would remain to be executed unbounded, which isn't supported. Specifically, if it's preceded by a Limit, it will be merged into a TopN later in the "cleanup" optimization stage.

See also PruneRedundantOrderBy.