Class AvgAggFunction
- java.lang.Object
-
- org.apache.flink.table.functions.UserDefinedFunction
-
- org.apache.flink.table.functions.DeclarativeAggregateFunction
-
- org.apache.flink.table.planner.functions.aggfunctions.AvgAggFunction
-
- All Implemented Interfaces:
Serializable
,FunctionDefinition
- Direct Known Subclasses:
AvgAggFunction.ByteAvgAggFunction
,AvgAggFunction.DecimalAvgAggFunction
,AvgAggFunction.DoubleAvgAggFunction
,AvgAggFunction.FloatAvgAggFunction
,AvgAggFunction.IntAvgAggFunction
,AvgAggFunction.LongAvgAggFunction
,AvgAggFunction.ShortAvgAggFunction
public abstract class AvgAggFunction extends DeclarativeAggregateFunction
built-in avg aggregate function.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AvgAggFunction.ByteAvgAggFunction
Built-in Byte Avg aggregate function.static class
AvgAggFunction.DecimalAvgAggFunction
Built-in Decimal Avg aggregate function.static class
AvgAggFunction.DoubleAvgAggFunction
Built-in Double Avg aggregate function.static class
AvgAggFunction.FloatAvgAggFunction
Built-in Float Avg aggregate function.static class
AvgAggFunction.IntAvgAggFunction
Built-in Integer Avg aggregate function.static class
AvgAggFunction.LongAvgAggFunction
Built-in Long Avg aggregate function.static class
AvgAggFunction.ShortAvgAggFunction
Built-in Short Avg aggregate function.
-
Constructor Summary
Constructors Constructor Description AvgAggFunction()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Expression[]
accumulateExpressions()
Expressions for accumulating the mutable aggregation buffer based on an input row.protected UnresolvedCallExpression
adjustedMinus(UnresolvedReferenceExpression arg1, UnresolvedReferenceExpression arg2)
protected UnresolvedCallExpression
adjustedPlus(UnresolvedReferenceExpression arg1, UnresolvedReferenceExpression arg2)
UnresolvedReferenceExpression[]
aggBufferAttributes()
All fields of the aggregate buffer.DataType[]
getAggBufferTypes()
All types of the aggregate buffer.abstract DataType
getSumType()
Expression
getValueExpression()
If all input are nulls, count will be 0 and we will get null after the division.Expression[]
initialValuesExpressions()
Expressions for initializing empty aggregation buffers.Expression[]
mergeExpressions()
A sequence of expressions for merging two aggregation buffers together.int
operandCount()
How many operands your function will deal with.Expression[]
retractExpressions()
Expressions for retracting the mutable aggregation buffer based on an input row.-
Methods inherited from class org.apache.flink.table.functions.DeclarativeAggregateFunction
getKind, getResultType, getTypeInference, 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
-
-
-
-
Method Detail
-
getSumType
public abstract DataType getSumType()
-
operandCount
public int operandCount()
Description copied from class:DeclarativeAggregateFunction
How many operands your function will deal with.- Specified by:
operandCount
in classDeclarativeAggregateFunction
-
aggBufferAttributes
public UnresolvedReferenceExpression[] aggBufferAttributes()
Description copied from class:DeclarativeAggregateFunction
All fields of the aggregate buffer.- Specified by:
aggBufferAttributes
in classDeclarativeAggregateFunction
-
getAggBufferTypes
public DataType[] getAggBufferTypes()
Description copied from class:DeclarativeAggregateFunction
All types of the aggregate buffer.- Specified by:
getAggBufferTypes
in classDeclarativeAggregateFunction
-
initialValuesExpressions
public Expression[] initialValuesExpressions()
Description copied from class:DeclarativeAggregateFunction
Expressions for initializing empty aggregation buffers.- Specified by:
initialValuesExpressions
in classDeclarativeAggregateFunction
-
accumulateExpressions
public Expression[] accumulateExpressions()
Description copied from class:DeclarativeAggregateFunction
Expressions for accumulating the mutable aggregation buffer based on an input row.- Specified by:
accumulateExpressions
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()
If all input are nulls, count will be 0 and we will get null after the division.- Specified by:
getValueExpression
in classDeclarativeAggregateFunction
-
adjustedPlus
protected UnresolvedCallExpression adjustedPlus(UnresolvedReferenceExpression arg1, UnresolvedReferenceExpression arg2)
-
adjustedMinus
protected UnresolvedCallExpression adjustedMinus(UnresolvedReferenceExpression arg1, UnresolvedReferenceExpression arg2)
-
-