public abstract class LeadLagAggFunction
extends org.apache.flink.table.functions.DeclarativeAggregateFunction
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.
| Modifier and Type | Class and Description |
|---|---|
static class |
LeadLagAggFunction.BooleanLeadLagAggFunction
BooleanLeadLagAggFunction.
|
static class |
LeadLagAggFunction.ByteLeadLagAggFunction
ByteLeadLagAggFunction.
|
static class |
LeadLagAggFunction.CharLeadLagAggFunction
CharLeadLagAggFunction.
|
static class |
LeadLagAggFunction.DateLeadLagAggFunction
DateLeadLagAggFunction.
|
static class |
LeadLagAggFunction.DecimalLeadLagAggFunction
DecimalLeadLagAggFunction.
|
static class |
LeadLagAggFunction.DoubleLeadLagAggFunction
DoubleLeadLagAggFunction.
|
static class |
LeadLagAggFunction.FloatLeadLagAggFunction
FloatLeadLagAggFunction.
|
static class |
LeadLagAggFunction.IntLeadLagAggFunction
IntLeadLagAggFunction.
|
static class |
LeadLagAggFunction.LongLeadLagAggFunction
LongLeadLagAggFunction.
|
static class |
LeadLagAggFunction.ShortLeadLagAggFunction
ShortLeadLagAggFunction.
|
static class |
LeadLagAggFunction.StringLeadLagAggFunction
StringLeadLagAggFunction.
|
static class |
LeadLagAggFunction.TimeLeadLagAggFunction
TimeLeadLagAggFunction.
|
static class |
LeadLagAggFunction.TimestampLeadLagAggFunction
TimestampLeadLagAggFunction.
|
| Constructor and Description |
|---|
LeadLagAggFunction(int operandCount) |
| Modifier and Type | Method and Description |
|---|---|
org.apache.flink.table.expressions.Expression[] |
accumulateExpressions() |
org.apache.flink.table.expressions.UnresolvedReferenceExpression[] |
aggBufferAttributes() |
org.apache.flink.table.types.DataType[] |
getAggBufferTypes() |
org.apache.flink.table.expressions.Expression |
getValueExpression() |
org.apache.flink.table.expressions.Expression[] |
initialValuesExpressions() |
org.apache.flink.table.expressions.Expression[] |
mergeExpressions() |
int |
operandCount() |
org.apache.flink.table.expressions.Expression[] |
retractExpressions() |
getKind, getResultType, getTypeInference, mergeOperand, mergeOperands, operand, operandsclose, functionIdentifier, open, toStringpublic int operandCount()
operandCount in class org.apache.flink.table.functions.DeclarativeAggregateFunctionpublic org.apache.flink.table.expressions.UnresolvedReferenceExpression[] aggBufferAttributes()
aggBufferAttributes in class org.apache.flink.table.functions.DeclarativeAggregateFunctionpublic org.apache.flink.table.types.DataType[] getAggBufferTypes()
getAggBufferTypes in class org.apache.flink.table.functions.DeclarativeAggregateFunctionpublic org.apache.flink.table.expressions.Expression[] initialValuesExpressions()
initialValuesExpressions in class org.apache.flink.table.functions.DeclarativeAggregateFunctionpublic org.apache.flink.table.expressions.Expression[] accumulateExpressions()
accumulateExpressions in class org.apache.flink.table.functions.DeclarativeAggregateFunctionpublic org.apache.flink.table.expressions.Expression[] retractExpressions()
retractExpressions in class org.apache.flink.table.functions.DeclarativeAggregateFunctionpublic org.apache.flink.table.expressions.Expression[] mergeExpressions()
mergeExpressions in class org.apache.flink.table.functions.DeclarativeAggregateFunctionpublic org.apache.flink.table.expressions.Expression getValueExpression()
getValueExpression in class org.apache.flink.table.functions.DeclarativeAggregateFunctionCopyright © 2014–2025 The Apache Software Foundation. All rights reserved.