Package org.apache.calcite.rel.rules
Class ProjectToWindowRule
- java.lang.Object
-
- org.apache.calcite.plan.RelOptRule
-
- org.apache.calcite.rel.rules.ProjectToWindowRule
-
- Direct Known Subclasses:
ProjectToWindowRule.CalcToWindowRule
,ProjectToWindowRule.ProjectToLogicalProjectAndWindowRule
public abstract class ProjectToWindowRule extends RelOptRule
Planner rule that slices aProject
into sections which contain windowed aggregate functions and sections which do not.The sections which contain windowed agg functions become instances of
LogicalWindow
. If theLogicalCalc
does not contain any windowed agg functions, does nothing.There is also a variant that matches
Calc
rather thanProject
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ProjectToWindowRule.CalcToWindowRule
Instance of the rule that applies to aCalc
that contains windowed aggregates and converts it into a mixture ofLogicalWindow
andCalc
.static class
ProjectToWindowRule.ProjectToLogicalProjectAndWindowRule
Instance of the rule that can be applied to aProject
and that produces, in turn, a mixture ofLogicalProject
andLogicalWindow
.(package private) static class
ProjectToWindowRule.WindowedAggRelSplitter
Splitter that distinguishes between windowed aggregation expressions (calls toRexOver
) and ordinary expressions.
-
Field Summary
Fields Modifier and Type Field Description static ProjectToWindowRule
INSTANCE
static ProjectToWindowRule
PROJECT
-
Fields inherited from class org.apache.calcite.plan.RelOptRule
description, operands, relBuilderFactory
-
-
Constructor Summary
Constructors Constructor Description ProjectToWindowRule(RelOptRuleOperand operand, RelBuilderFactory relBuilderFactory, java.lang.String description)
Creates a ProjectToWindowRule.
-
Method Summary
-
Methods inherited from class org.apache.calcite.plan.RelOptRule
any, convert, convert, convertList, convertOperand, convertOperand, equals, equals, getOperand, getOperands, getOutConvention, getOutTrait, hashCode, matches, none, onMatch, operand, operand, operand, operand, operand, operandJ, operandJ, some, toString, unordered
-
-
-
-
Field Detail
-
INSTANCE
public static final ProjectToWindowRule INSTANCE
-
PROJECT
public static final ProjectToWindowRule PROJECT
-
-
Constructor Detail
-
ProjectToWindowRule
public ProjectToWindowRule(RelOptRuleOperand operand, RelBuilderFactory relBuilderFactory, java.lang.String description)
Creates a ProjectToWindowRule.- Parameters:
operand
- Root operand, must not be nulldescription
- Description, or null to guess descriptionrelBuilderFactory
- Builder for relational expressions
-
-