public class SqlGroupFunction
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:
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
Constructor and Description |
---|
SqlGroupFunction(org.apache.calcite.sql.SqlKind kind,
SqlGroupFunction groupFunction,
org.apache.calcite.sql.type.SqlOperandTypeChecker operandTypeChecker)
Creates a SqlGroupFunction.
|
SqlGroupFunction(String name,
org.apache.calcite.sql.SqlKind kind,
SqlGroupFunction groupFunction,
org.apache.calcite.sql.type.SqlOperandTypeChecker operandTypeChecker)
Creates a SqlGroupFunction.
|
SqlGroupFunction(String name,
org.apache.calcite.sql.SqlKind kind,
SqlGroupFunction groupFunction,
org.apache.calcite.sql.type.SqlReturnTypeInference returnTypeInference,
org.apache.calcite.sql.type.SqlOperandTypeChecker operandTypeChecker)
Creates a SqlGroupFunction.
|
Modifier and Type | Method and Description |
---|---|
SqlGroupFunction |
auxiliary(org.apache.calcite.sql.SqlKind kind)
Creates an auxiliary function from this grouped window function.
|
SqlGroupFunction |
auxiliary(String name,
org.apache.calcite.sql.SqlKind kind)
Creates an auxiliary function from this grouped window function.
|
List<SqlGroupFunction> |
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, hashCode, inferReturnType, inferReturnType, isAggregator, isDeterministic, isDynamicFunction, isName, leftPrec, preValidateCall, requiresDecimalExpansion, requiresOrder, requiresOver, rewriteCall, rightPrec, toString, unparseListClause, unparseListClause, validateOperands, validRexOperands
public SqlGroupFunction(String name, org.apache.calcite.sql.SqlKind kind, SqlGroupFunction 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 functionoperandTypeChecker
- Operand type checkerpublic SqlGroupFunction(org.apache.calcite.sql.SqlKind kind, SqlGroupFunction groupFunction, org.apache.calcite.sql.type.SqlOperandTypeChecker operandTypeChecker)
kind
- Kind; also determines function namegroupFunction
- Group function, if this is an auxiliary;
null, if this is a group functionoperandTypeChecker
- Operand type checkerpublic SqlGroupFunction(String name, org.apache.calcite.sql.SqlKind kind, SqlGroupFunction groupFunction, org.apache.calcite.sql.type.SqlReturnTypeInference returnTypeInference, org.apache.calcite.sql.type.SqlOperandTypeChecker operandTypeChecker)
name
- Function namekind
- KindgroupFunction
- Group function, if this is an auxiliary;
null, if this is a group functionreturnTypeInference
- Inference of the functions return typeoperandTypeChecker
- Operand type checkerpublic SqlGroupFunction auxiliary(org.apache.calcite.sql.SqlKind kind)
kind
- Kind; also determines function namepublic SqlGroupFunction auxiliary(String name, org.apache.calcite.sql.SqlKind kind)
name
- Function namekind
- Kindpublic List<SqlGroupFunction> 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–2018 The Apache Software Foundation. All rights reserved.