Class RexWindowBound

java.lang.Object
org.apache.calcite.rex.RexWindowBound

public abstract class RexWindowBound extends Object
Abstracts "XX PRECEDING/FOLLOWING" and "CURRENT ROW" bounds for windowed aggregates.
See Also:
  • Constructor Details

    • RexWindowBound

      public RexWindowBound()
  • Method Details

    • create

      @Deprecated public static RexWindowBound create(SqlNode node, RexNode rexNode)
      Deprecated.
    • isUnbounded

      @Pure @EnsuresNonNullIf(expression="getOffset()", result=false) public boolean isUnbounded()
      Returns if the bound is unbounded.
      Returns:
      if the bound is unbounded
    • isUnboundedPreceding

      public final boolean isUnboundedPreceding()
      Returns whether the bound is UNBOUNDED PRECEDING.
    • isUnboundedFollowing

      public final boolean isUnboundedFollowing()
      Returns whether the bound is UNBOUNDED FOLLOWING.
    • isPreceding

      public boolean isPreceding()
      Returns if the bound is PRECEDING.
      Returns:
      if the bound is PRECEDING
    • isFollowing

      public boolean isFollowing()
      Returns if the bound is FOLLOWING.
      Returns:
      if the bound is FOLLOWING
    • isCurrentRow

      @Pure @EnsuresNonNullIf(expression="getOffset()", result=false) public boolean isCurrentRow()
      Returns if the bound is CURRENT ROW.
      Returns:
      if the bound is CURRENT ROW
    • getOffset

      @Pure public @Nullable RexNode getOffset()
      Returns offset from XX PRECEDING/FOLLOWING.
      Returns:
      offset from XX PRECEDING/FOLLOWING
    • getOrderKey

      public int getOrderKey()
      Returns relative sort offset when known at compile time. For instance, UNBOUNDED PRECEDING is less than CURRENT ROW.
      Returns:
      relative order or -1 when order is not known
    • accept

      public <R> RexWindowBound accept(RexVisitor<R> visitor)
      Transforms the bound via RexVisitor.
      Type Parameters:
      R - return type of the visitor
      Parameters:
      visitor - visitor to accept
      Returns:
      transformed bound
    • accept

      public <R, P> RexWindowBound accept(RexBiVisitor<R,P> visitor, P arg)
      Transforms the bound via RexBiVisitor.
      Type Parameters:
      R - return type of the visitor
      Parameters:
      visitor - visitor to accept
      arg - Payload
      Returns:
      transformed bound
    • nodeCount

      public int nodeCount()
      Returns the number of nodes in this bound.
      See Also: