Class GatherAndMergeWindows.MergeAdjacentWindowsOverProjects
java.lang.Object
io.trino.sql.planner.iterative.rule.GatherAndMergeWindows.MergeAdjacentWindowsOverProjects
- All Implemented Interfaces:
Rule<WindowNode>
- Enclosing class:
GatherAndMergeWindows
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.trino.sql.planner.iterative.Rule
Rule.Context, Rule.Result -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(WindowNode parent, Captures captures, Rule.Context context) Returns a pattern to which plan nodes this rule applies.manipulateAdjacentWindowNodes(WindowNode parent, WindowNode child, Rule.Context context) protected static Optional<WindowNode> pullWindowNodeAboveProjects(WindowNode target, List<ProjectNode> projects) Looks for the pattern (ProjectNode*)WindowNode, and rewrites it to WindowNode(ProjectNode*), returning an empty option if it can't rewrite the projects, for example because they rely on the output of the WindowNode.
-
Constructor Details
-
MergeAdjacentWindowsOverProjects
public MergeAdjacentWindowsOverProjects(int numProjects)
-
-
Method Details
-
manipulateAdjacentWindowNodes
protected Optional<PlanNode> manipulateAdjacentWindowNodes(WindowNode parent, WindowNode child, Rule.Context context) -
getPattern
Description copied from interface:RuleReturns a pattern to which plan nodes this rule applies.- Specified by:
getPatternin interfaceRule<WindowNode>
-
apply
- Specified by:
applyin interfaceRule<WindowNode>
-
pullWindowNodeAboveProjects
protected static Optional<WindowNode> pullWindowNodeAboveProjects(WindowNode target, List<ProjectNode> projects) Looks for the pattern (ProjectNode*)WindowNode, and rewrites it to WindowNode(ProjectNode*), returning an empty option if it can't rewrite the projects, for example because they rely on the output of the WindowNode.- Parameters:
projects- the nodes above the target, bottom first.
-