public interface OverWindowFrame extends Serializable
E.g.: SELECT d, e, f, sum(e) over (partition by d order by e rows between 5 PRECEDING and 2 FOLLOWING), -- frame 1 count(*) over (partition by d order by e desc rows between 6 PRECEDING and 2 FOLLOWING), -- frame 2 max(f) over (partition by d order by e rows between UNBOUNDED PRECEDING and CURRENT ROW), -- frame 3 min(h) over (partition by d order by e desc rows between CURRENT ROW and UNBOUNDED FOLLOWING), -- frame 4 h FROM Table5 The above sql has 4 frames.
Over AGG means that every Row has a corresponding output. OverWindowFrame is called by: 1.Get
all data and invoke prepare(ResettableExternalBuffer) for partition 2.Then each Row is
traversed one by one to invoke process(int, RowData) to get the calculation results of
the currentRow.
| Modifier and Type | Method and Description |
|---|---|
static org.apache.flink.table.data.binary.BinaryRowData |
getNextOrNull(ResettableExternalBuffer.BufferIterator iterator)
Get next row from iterator.
|
void |
open(ExecutionContext ctx)
Open to init with
ExecutionContext. |
void |
prepare(ResettableExternalBuffer rows)
Prepare for next partition.
|
org.apache.flink.table.data.RowData |
process(int index,
org.apache.flink.table.data.RowData current)
return the ACC of the window frame.
|
void open(ExecutionContext ctx) throws Exception
ExecutionContext.Exceptionvoid prepare(ResettableExternalBuffer rows) throws Exception
Exceptionorg.apache.flink.table.data.RowData process(int index,
org.apache.flink.table.data.RowData current)
throws Exception
Exceptionstatic org.apache.flink.table.data.binary.BinaryRowData getNextOrNull(ResettableExternalBuffer.BufferIterator iterator)
Copyright © 2014–2025 The Apache Software Foundation. All rights reserved.