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 Detail

      • groupFunction

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

      • SqlGroupedWindowFunction

        public SqlGroupedWindowFunction​(java.lang.String name,
                                        SqlKind kind,
                                        SqlGroupedWindowFunction groupFunction,
                                        SqlReturnTypeInference returnTypeInference,
                                        SqlOperandTypeInference operandTypeInference,
                                        SqlOperandTypeChecker operandTypeChecker,
                                        SqlFunctionCategory category)
        Creates a SqlGroupedWindowFunction.
        Parameters:
        name - Function name
        kind - Kind
        groupFunction - Group function, if this is an auxiliary; null, if this is a group function
        returnTypeInference - Strategy to use for return type inference
        operandTypeInference - Strategy to use for parameter type inference
        operandTypeChecker - Strategy to use for parameter type checking
        category - Categorization for function
    • Method Detail

      • 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​(java.lang.String name,
                                                  SqlKind kind)
        Creates an auxiliary function from this grouped window function.
        Parameters:
        name - Function name
        kind - Kind
      • getAuxiliaryFunctions

        public java.util.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