Class WindowOperatorBuilder
- java.lang.Object
-
- org.apache.flink.table.runtime.operators.window.groupwindow.operator.WindowOperatorBuilder
-
public class WindowOperatorBuilder extends Object
TheWindowOperatorBuilder
is used to buildWindowOperator
fluently.Note: You have to call the aggregate method before the last build method.
WindowOperatorBuilder .builder(KeyedStream) .tumble(Duration.ofMinutes(1)) // sliding(...), session(...) .withEventTime() // withProcessingTime() .withAllowedLateness(Duration.ZERO) .produceUpdates() .aggregate(AggregationsFunction, accTypes, windowTypes) .build();
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WindowOperatorBuilder.AggregateWindowOperatorBuilder
The builder which is used to buildAggregateWindowOperator
fluently.static class
WindowOperatorBuilder.TableAggregateWindowOperatorBuilder
The builder which is used to buildTableAggregateWindowOperator
fluently.
-
Field Summary
Fields Modifier and Type Field Description protected LogicalType[]
accumulatorTypes
protected LogicalType[]
aggResultTypes
protected long
allowedLateness
protected int
inputCountIndex
protected LogicalType[]
inputFieldTypes
protected boolean
produceUpdates
protected int
rowtimeIndex
protected ZoneId
shiftTimeZone
protected Trigger<?>
trigger
protected GroupWindowAssigner<?>
windowAssigner
protected LogicalType[]
windowPropertyTypes
-
Constructor Summary
Constructors Constructor Description WindowOperatorBuilder()
-
Method Summary
-
-
-
Field Detail
-
inputFieldTypes
protected LogicalType[] inputFieldTypes
-
windowAssigner
protected GroupWindowAssigner<?> windowAssigner
-
trigger
protected Trigger<?> trigger
-
accumulatorTypes
protected LogicalType[] accumulatorTypes
-
aggResultTypes
protected LogicalType[] aggResultTypes
-
windowPropertyTypes
protected LogicalType[] windowPropertyTypes
-
allowedLateness
protected long allowedLateness
-
produceUpdates
protected boolean produceUpdates
-
rowtimeIndex
protected int rowtimeIndex
-
shiftTimeZone
protected ZoneId shiftTimeZone
-
inputCountIndex
protected int inputCountIndex
-
-
Method Detail
-
builder
public static WindowOperatorBuilder builder()
-
withInputFields
public WindowOperatorBuilder withInputFields(LogicalType[] inputFieldTypes)
-
withShiftTimezone
public WindowOperatorBuilder withShiftTimezone(ZoneId shiftTimeZone)
The shift timezone of the window, if the proctime or rowtime type is TIMESTAMP_LTZ, the shift timezone is the timezone user configured in TableConfig, other cases the timezone is UTC which means never shift when assigning windows.
-
tumble
public WindowOperatorBuilder tumble(Duration size)
-
sliding
public WindowOperatorBuilder sliding(Duration size, Duration slide)
-
cumulative
public WindowOperatorBuilder cumulative(Duration size, Duration step)
-
session
public WindowOperatorBuilder session(Duration sessionGap)
-
countWindow
public WindowOperatorBuilder countWindow(long size)
-
countWindow
public WindowOperatorBuilder countWindow(long size, long slide)
-
assigner
public WindowOperatorBuilder assigner(GroupWindowAssigner<?> windowAssigner)
-
triggering
public WindowOperatorBuilder triggering(Trigger<?> trigger)
-
withEventTime
public WindowOperatorBuilder withEventTime(int rowtimeIndex)
-
withProcessingTime
public WindowOperatorBuilder withProcessingTime()
-
withAllowedLateness
public WindowOperatorBuilder withAllowedLateness(Duration allowedLateness)
-
produceUpdates
public WindowOperatorBuilder produceUpdates()
-
withInputCountIndex
public WindowOperatorBuilder withInputCountIndex(int inputCountIndex)
The index of COUNT(*) in the aggregates. -1 when the input doesn't * contain COUNT(*), i.e. doesn't contain retraction messages. We make sure there is a * COUNT(*) if input stream contains retraction.
-
aggregate
protected void aggregate(LogicalType[] accumulatorTypes, LogicalType[] aggResultTypes, LogicalType[] windowPropertyTypes)
-
aggregate
public WindowOperatorBuilder.AggregateWindowOperatorBuilder aggregate(NamespaceAggsHandleFunction<?> aggregateFunction, RecordEqualiser equaliser, LogicalType[] accumulatorTypes, LogicalType[] aggResultTypes, LogicalType[] windowPropertyTypes)
-
aggregate
public WindowOperatorBuilder.AggregateWindowOperatorBuilder aggregate(GeneratedNamespaceAggsHandleFunction<?> generatedAggregateFunction, GeneratedRecordEqualiser generatedEqualiser, LogicalType[] accumulatorTypes, LogicalType[] aggResultTypes, LogicalType[] windowPropertyTypes)
-
aggregate
public WindowOperatorBuilder.TableAggregateWindowOperatorBuilder aggregate(NamespaceTableAggsHandleFunction<?> tableAggregateFunction, LogicalType[] accumulatorTypes, LogicalType[] aggResultTypes, LogicalType[] windowPropertyTypes)
-
aggregate
public WindowOperatorBuilder.TableAggregateWindowOperatorBuilder aggregate(GeneratedNamespaceTableAggsHandleFunction<?> generatedTableAggregateFunction, LogicalType[] accumulatorTypes, LogicalType[] aggResultTypes, LogicalType[] windowPropertyTypes)
-
-