Class ImplementLimitWithTies
- java.lang.Object
-
- io.trino.sql.planner.iterative.rule.ImplementLimitWithTies
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.trino.sql.planner.iterative.Rule
Rule.Context, Rule.Result
-
-
Constructor Summary
Constructors Constructor Description ImplementLimitWithTies(Metadata metadata)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Rule.Resultapply(LimitNode parent, Captures captures, Rule.Context context)Pattern<LimitNode>getPattern()Returns a pattern to which plan nodes this rule applies.static PlanNoderewriteLimitWithTiesWithPartitioning(LimitNode limitNode, PlanNode source, Session session, Metadata metadata, PlanNodeIdAllocator idAllocator, SymbolAllocator symbolAllocator, List<Symbol> partitionBy)Rewrite LimitNode with ties to WindowNode and FilterNode, with partitioning defined by partitionBy.
-
-
-
Constructor Detail
-
ImplementLimitWithTies
public ImplementLimitWithTies(Metadata metadata)
-
-
Method Detail
-
getPattern
public Pattern<LimitNode> getPattern()
Description copied from interface:RuleReturns a pattern to which plan nodes this rule applies.- Specified by:
getPatternin interfaceRule<LimitNode>
-
apply
public Rule.Result apply(LimitNode parent, Captures captures, Rule.Context context)
-
rewriteLimitWithTiesWithPartitioning
public static PlanNode rewriteLimitWithTiesWithPartitioning(LimitNode limitNode, PlanNode source, Session session, Metadata metadata, PlanNodeIdAllocator idAllocator, SymbolAllocator symbolAllocator, List<Symbol> partitionBy)
Rewrite LimitNode with ties to WindowNode and FilterNode, with partitioning defined by partitionBy.This method does not prune outputs of the rewritten plan. After the rewrite, the output consists of source's output symbols and the newly created rankSymbol. Passing all input symbols is intentional, because this method is used for de-correlation in the scenario where the original LimitNode is in the correlated subquery, and the rewrite result is placed on top of de-correlated join. It is the responsibility of the caller to prune redundant outputs.
-
-