public class SqlGroupedWindowFunction
extends org.apache.calcite.sql.SqlFunction
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:
Note: we copied the implementation from Calcite's SqlGroupedWindowFunction
because of CALCITE-4563, Calcite currently
doesn't allow to set the SqlReturnTypeInference of auxiliary SqlGroupedWindowFunction.
The motivation is using TIMESTAMP type for the window start and window end no matter the time attribute column is TIMESTAMP or TIMESTAMP_LTZ.
Modifier and Type | Field and Description |
---|---|
SqlGroupedWindowFunction |
groupFunction
The grouped function, if this an auxiliary function; null otherwise.
|
Constructor and Description |
---|
SqlGroupedWindowFunction(String name,
org.apache.calcite.sql.SqlKind kind,
SqlGroupedWindowFunction groupFunction,
org.apache.calcite.sql.type.SqlOperandTypeChecker operandTypeChecker)
Creates a SqlGroupedWindowFunction.
|
SqlGroupedWindowFunction(String name,
org.apache.calcite.sql.SqlKind kind,
SqlGroupedWindowFunction groupFunction,
org.apache.calcite.sql.type.SqlReturnTypeInference returnTypeInference,
org.apache.calcite.sql.type.SqlOperandTypeInference operandTypeInference,
org.apache.calcite.sql.type.SqlOperandTypeChecker operandTypeChecker,
org.apache.calcite.sql.SqlFunctionCategory category)
Creates a SqlGroupedWindowFunction.
|
Modifier and Type | Method and Description |
---|---|
SqlGroupedWindowFunction |
auxiliary(org.apache.calcite.sql.SqlKind kind)
Creates an auxiliary function from this grouped window function.
|
SqlGroupedWindowFunction |
auxiliary(String name,
org.apache.calcite.sql.SqlKind kind)
Creates an auxiliary function from this grouped window function.
|
List<SqlGroupedWindowFunction> |
getAuxiliaryFunctions()
Returns a list of this grouped window function's auxiliary functions.
|
org.apache.calcite.sql.validate.SqlMonotonicity |
getMonotonicity(org.apache.calcite.sql.SqlOperatorBinding call) |
boolean |
isGroup() |
boolean |
isGroupAuxiliary() |
deriveType, getFunctionType, getNameAsId, getParamNames, getParamTypes, getSqlIdentifier, getSyntax, isQuantifierAllowed, unparse, validateCall, validateQuantifier
acceptCall, acceptCall, adjustType, allowsFraming, argumentMustBeScalar, checkOperandCount, checkOperandTypes, constructArgNameList, constructArgTypeList, constructOperandList, createCall, createCall, createCall, createCall, equals, getAllowedSignatures, getAllowedSignatures, getKind, getLeftPrec, getMonotonicity, getName, getOperandCountRange, getOperandTypeChecker, getOperandTypeInference, getReturnTypeInference, getRightPrec, getSignatureTemplate, getStrongPolicyInference, hashCode, inferReturnType, inferReturnType, isAggregator, isDeterministic, isDynamicFunction, isName, isSymmetrical, leftPrec, preValidateCall, requiresDecimalExpansion, requiresOrder, requiresOver, rewriteCall, rightPrec, toString, unparseListClause, unparseListClause, validateOperands, validRexOperands
public final SqlGroupedWindowFunction groupFunction
public SqlGroupedWindowFunction(String name, org.apache.calcite.sql.SqlKind kind, SqlGroupedWindowFunction groupFunction, org.apache.calcite.sql.type.SqlReturnTypeInference returnTypeInference, org.apache.calcite.sql.type.SqlOperandTypeInference operandTypeInference, org.apache.calcite.sql.type.SqlOperandTypeChecker operandTypeChecker, org.apache.calcite.sql.SqlFunctionCategory category)
name
- Function namekind
- KindgroupFunction
- Group function, if this is an auxiliary; null, if this is a group
functionreturnTypeInference
- Strategy to use for return type inferenceoperandTypeInference
- Strategy to use for parameter type inferenceoperandTypeChecker
- Strategy to use for parameter type checkingcategory
- Categorization for functionpublic SqlGroupedWindowFunction(String name, org.apache.calcite.sql.SqlKind kind, SqlGroupedWindowFunction groupFunction, org.apache.calcite.sql.type.SqlOperandTypeChecker operandTypeChecker)
name
- Function namekind
- KindgroupFunction
- Group function, if this is an auxiliary; null, if this is a group
functionpublic SqlGroupedWindowFunction auxiliary(org.apache.calcite.sql.SqlKind kind)
kind
- Kind; also determines function namepublic SqlGroupedWindowFunction auxiliary(String name, org.apache.calcite.sql.SqlKind kind)
name
- Function namekind
- Kindpublic List<SqlGroupedWindowFunction> getAuxiliaryFunctions()
public boolean isGroup()
isGroup
in class org.apache.calcite.sql.SqlOperator
public boolean isGroupAuxiliary()
isGroupAuxiliary
in class org.apache.calcite.sql.SqlOperator
public org.apache.calcite.sql.validate.SqlMonotonicity getMonotonicity(org.apache.calcite.sql.SqlOperatorBinding call)
getMonotonicity
in class org.apache.calcite.sql.SqlOperator
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.