Class Window

  • All Implemented Interfaces:
    java.lang.Cloneable, RelOptNode, RelNode
    Direct Known Subclasses:
    Bindables.BindableWindow, EnumerableWindow, LogicalWindow

    public abstract class Window
    extends SingleRel
    A relational expression representing a set of window aggregates.

    A Window can handle several window aggregate functions, over several partitions, with pre- and post-expressions, and an optional post-filter. Each of the partitions is defined by a partition key (zero or more columns) and a range (logical or physical). The partitions expect the data to be sorted correctly on input to the relational expression.

    Each Window.Group has a set of RexOver objects.

    Created by ProjectToWindowRule.

    • Field Detail

      • groups

        public final com.google.common.collect.ImmutableList<Window.Group> groups
      • constants

        public final com.google.common.collect.ImmutableList<RexLiteral> constants
    • Constructor Detail

      • Window

        public Window​(RelOptCluster cluster,
                      RelTraitSet traitSet,
                      RelNode input,
                      java.util.List<RexLiteral> constants,
                      RelDataType rowType,
                      java.util.List<Window.Group> groups)
        Creates a window relational expression.
        Parameters:
        cluster - Cluster
        traitSet - Trait set
        input - Input relational expression
        constants - List of constants that are additional inputs
        rowType - Output row type
        groups - Windows
    • Method Detail

      • isValid

        public boolean isValid​(Litmus litmus,
                               RelNode.Context context)
        Description copied from interface: RelNode
        Returns whether this relational expression is valid.

        If assertions are enabled, this method is typically called with litmus = THROW, as follows:

        assert rel.isValid(Litmus.THROW)

        This signals that the method can throw an AssertionError if it is not valid.

        Specified by:
        isValid in interface RelNode
        Overrides:
        isValid in class AbstractRelNode
        Parameters:
        litmus - What to do if invalid
        context - Context for validity checking
        Returns:
        Whether relational expression is valid
      • getConstants

        public java.util.List<RexLiteral> getConstants()
        Returns constants that are additional inputs of current relation.
        Returns:
        constants that are additional inputs of current relation