Class HoistRemoteEnrichLimit

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

Locate any LIMIT that is "visible" under remote ENRICH, and make a copy of it above the ENRICH. The original limit is marked as local. This allows the correct semantics of the remote application of limit. Enrich itself does not change the cardinality, but the limit needs to be taken twice, locally on the node and again on the coordinator. This runs only on LogicalPlanOptimizer not on local one.