Class RankLikeAggFunctionBase
- java.lang.Object
-
- org.apache.flink.table.functions.UserDefinedFunction
-
- org.apache.flink.table.functions.DeclarativeAggregateFunction
-
- org.apache.flink.table.planner.functions.aggfunctions.RankLikeAggFunctionBase
-
- All Implemented Interfaces:
Serializable
,FunctionDefinition
- Direct Known Subclasses:
DenseRankAggFunction
,RankAggFunction
public abstract class RankLikeAggFunctionBase extends DeclarativeAggregateFunction
built-in rank like aggregate function, e.g. rank, dense_rank- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected UnresolvedReferenceExpression[]
lastValues
protected LogicalType[]
orderKeyTypes
protected UnresolvedReferenceExpression
sequence
-
Constructor Summary
Constructors Constructor Description RankLikeAggFunctionBase(LogicalType[] orderKeyTypes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Expression
generateInitLiteral(LogicalType orderType)
DataType
getResultType()
The result type of the function.Expression
getValueExpression()
An expression which returns the final value for this aggregate function.Expression[]
mergeExpressions()
A sequence of expressions for merging two aggregation buffers together.int
operandCount()
How many operands your function will deal with.protected Expression
orderKeyEqualsExpression()
Expression[]
retractExpressions()
Expressions for retracting the mutable aggregation buffer based on an input row.-
Methods inherited from class org.apache.flink.table.functions.DeclarativeAggregateFunction
accumulateExpressions, aggBufferAttributes, getAggBufferTypes, getKind, getTypeInference, initialValuesExpressions, mergeOperand, mergeOperands, operand, operands
-
Methods inherited from class org.apache.flink.table.functions.UserDefinedFunction
close, functionIdentifier, open, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.flink.table.functions.FunctionDefinition
getRequirements, isDeterministic, supportsConstantFolding
-
-
-
-
Field Detail
-
sequence
protected UnresolvedReferenceExpression sequence
-
lastValues
protected UnresolvedReferenceExpression[] lastValues
-
orderKeyTypes
protected LogicalType[] orderKeyTypes
-
-
Constructor Detail
-
RankLikeAggFunctionBase
public RankLikeAggFunctionBase(LogicalType[] orderKeyTypes)
-
-
Method Detail
-
operandCount
public int operandCount()
Description copied from class:DeclarativeAggregateFunction
How many operands your function will deal with.- Specified by:
operandCount
in classDeclarativeAggregateFunction
-
getResultType
public DataType getResultType()
Description copied from class:DeclarativeAggregateFunction
The result type of the function.- Specified by:
getResultType
in classDeclarativeAggregateFunction
-
retractExpressions
public Expression[] retractExpressions()
Description copied from class:DeclarativeAggregateFunction
Expressions for retracting the mutable aggregation buffer based on an input row.- Specified by:
retractExpressions
in classDeclarativeAggregateFunction
-
mergeExpressions
public Expression[] mergeExpressions()
Description copied from class:DeclarativeAggregateFunction
A sequence of expressions for merging two aggregation buffers together. When defining these expressions, you can use the syntaxattributeName
andmergeOperand(attributeName)
to refer to the attributes corresponding to each of the buffers being merged.- Specified by:
mergeExpressions
in classDeclarativeAggregateFunction
-
getValueExpression
public Expression getValueExpression()
Description copied from class:DeclarativeAggregateFunction
An expression which returns the final value for this aggregate function.- Specified by:
getValueExpression
in classDeclarativeAggregateFunction
-
orderKeyEqualsExpression
protected Expression orderKeyEqualsExpression()
-
generateInitLiteral
protected Expression generateInitLiteral(LogicalType orderType)
-
-