Class LeadLagAggFunction
- All Implemented Interfaces:
Serializable,org.apache.flink.table.functions.FunctionDefinition
- Direct Known Subclasses:
LeadLagAggFunction.BooleanLeadLagAggFunction,LeadLagAggFunction.ByteLeadLagAggFunction,LeadLagAggFunction.CharLeadLagAggFunction,LeadLagAggFunction.DateLeadLagAggFunction,LeadLagAggFunction.DecimalLeadLagAggFunction,LeadLagAggFunction.DoubleLeadLagAggFunction,LeadLagAggFunction.FloatLeadLagAggFunction,LeadLagAggFunction.IntLeadLagAggFunction,LeadLagAggFunction.LongLeadLagAggFunction,LeadLagAggFunction.ShortLeadLagAggFunction,LeadLagAggFunction.StringLeadLagAggFunction,LeadLagAggFunction.TimeLeadLagAggFunction,LeadLagAggFunction.TimestampLeadLagAggFunction
LAG(input, offset, default) - Returns the value of `input` at the `offset`th row before the current row in the window. The default value of `offset` is 1 and the default value of `default` is null. If the value of `input` at the `offset`th row is null, null is returned. If there is no such offset row (e.g., when the offset is 1, the first row of the window does not have any previous row), `default` is returned.
LEAD(input, offset, default) - Returns the value of `input` at the `offset`th row after the current row in the window. The default value of `offset` is 1 and the default value of `default` is null. If the value of `input` at the `offset`th row is null, null is returned. If there is no such an offset row (e.g., when the offset is 1, the last row of the window does not have any subsequent row), `default` is returned.
These two aggregate functions are special, and only are used by over window. So here the
concrete implementation is closely related to OffsetOverFrame.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBooleanLeadLagAggFunction.static classByteLeadLagAggFunction.static classCharLeadLagAggFunction.static classDateLeadLagAggFunction.static classDecimalLeadLagAggFunction.static classDoubleLeadLagAggFunction.static classFloatLeadLagAggFunction.static classIntLeadLagAggFunction.static classLongLeadLagAggFunction.static classShortLeadLagAggFunction.static classStringLeadLagAggFunction.static classTimeLeadLagAggFunction.static classTimestampLeadLagAggFunction. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.flink.table.expressions.Expression[]org.apache.flink.table.expressions.UnresolvedReferenceExpression[]org.apache.flink.table.types.DataType[]org.apache.flink.table.expressions.Expressionorg.apache.flink.table.expressions.Expression[]org.apache.flink.table.expressions.Expression[]intorg.apache.flink.table.expressions.Expression[]Methods inherited from class org.apache.flink.table.functions.DeclarativeAggregateFunction
getKind, getResultType, getTypeInference, mergeOperand, mergeOperands, operand, operandsMethods inherited from class org.apache.flink.table.functions.UserDefinedFunction
close, functionIdentifier, open, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.flink.table.functions.FunctionDefinition
getRequirements, isDeterministic, supportsConstantFolding
-
Constructor Details
-
LeadLagAggFunction
public LeadLagAggFunction(int operandCount)
-
-
Method Details
-
operandCount
public int operandCount()- Specified by:
operandCountin classorg.apache.flink.table.functions.DeclarativeAggregateFunction
-
aggBufferAttributes
public org.apache.flink.table.expressions.UnresolvedReferenceExpression[] aggBufferAttributes()- Specified by:
aggBufferAttributesin classorg.apache.flink.table.functions.DeclarativeAggregateFunction
-
getAggBufferTypes
public org.apache.flink.table.types.DataType[] getAggBufferTypes()- Specified by:
getAggBufferTypesin classorg.apache.flink.table.functions.DeclarativeAggregateFunction
-
initialValuesExpressions
public org.apache.flink.table.expressions.Expression[] initialValuesExpressions()- Specified by:
initialValuesExpressionsin classorg.apache.flink.table.functions.DeclarativeAggregateFunction
-
accumulateExpressions
public org.apache.flink.table.expressions.Expression[] accumulateExpressions()- Specified by:
accumulateExpressionsin classorg.apache.flink.table.functions.DeclarativeAggregateFunction
-
retractExpressions
public org.apache.flink.table.expressions.Expression[] retractExpressions()- Specified by:
retractExpressionsin classorg.apache.flink.table.functions.DeclarativeAggregateFunction
-
mergeExpressions
public org.apache.flink.table.expressions.Expression[] mergeExpressions()- Specified by:
mergeExpressionsin classorg.apache.flink.table.functions.DeclarativeAggregateFunction
-
getValueExpression
public org.apache.flink.table.expressions.Expression getValueExpression()- Specified by:
getValueExpressionin classorg.apache.flink.table.functions.DeclarativeAggregateFunction
-