Class SqlGroupedWindowFunction


public class SqlGroupedWindowFunction extends SqlFunction
SQL function that computes keys by which rows can be partitioned and aggregated.

Grouped window functions always occur in the GROUP BY clause. They often have auxiliary functions that access information about the group. For example, HOP is a group function, and its auxiliary functions are HOP_START and HOP_END. Here they are used in a streaming query:

 SELECT STREAM HOP_START(rowtime, INTERVAL '1' HOUR),
   HOP_END(rowtime, INTERVAL '1' HOUR),
   MIN(unitPrice)
 FROM Orders
 GROUP BY HOP(rowtime, INTERVAL '1' HOUR), productId
 
  • Field Details

    • groupFunction

      public final @Nullable SqlGroupedWindowFunction groupFunction
      The grouped function, if this an auxiliary function; null otherwise.
  • Constructor Details

  • Method Details

    • auxiliary

      public SqlGroupedWindowFunction auxiliary(SqlKind kind)
      Creates an auxiliary function from this grouped window function.
      Parameters:
      kind - Kind; also determines function name
    • auxiliary

      public SqlGroupedWindowFunction auxiliary(String name, SqlKind kind)
      Creates an auxiliary function from this grouped window function.
      Parameters:
      name - Function name
      kind - Kind
    • getAuxiliaryFunctions

      public List<SqlGroupedWindowFunction> getAuxiliaryFunctions()
      Returns a list of this grouped window function's auxiliary functions.
    • isGroup

      public boolean isGroup()
      Description copied from class: SqlOperator
      Returns whether this is a group function.

      Group functions can only appear in the GROUP BY clause.

      Examples are HOP, TUMBLE, SESSION.

      Group functions have auxiliary functions, e.g. HOP_START, but these are not group functions.

      Overrides:
      isGroup in class SqlOperator
    • isGroupAuxiliary

      public boolean isGroupAuxiliary()
      Description copied from class: SqlOperator
      Returns whether this is an group auxiliary function.

      Examples are HOP_START and HOP_END (both auxiliary to HOP).

      Overrides:
      isGroupAuxiliary in class SqlOperator
      See Also:
    • getMonotonicity

      public SqlMonotonicity getMonotonicity(SqlOperatorBinding call)
      Description copied from class: SqlOperator
      Returns whether a call to this operator is monotonic.

      Default implementation returns SqlMonotonicity.NOT_MONOTONIC.

      Overrides:
      getMonotonicity in class SqlOperator
      Parameters:
      call - Call to this operator with particular arguments and information about the monotonicity of the arguments