Class WindowOperatorBuilder
- java.lang.Object
-
- org.apache.flink.table.runtime.operators.window.groupwindow.operator.WindowOperatorBuilder
-
public class WindowOperatorBuilder extends Object
TheWindowOperatorBuilderis used to buildWindowOperatorfluently.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 classWindowOperatorBuilder.AggregateWindowOperatorBuilderThe builder which is used to buildAggregateWindowOperatorfluently.static classWindowOperatorBuilder.TableAggregateWindowOperatorBuilderThe builder which is used to buildTableAggregateWindowOperatorfluently.
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.flink.table.types.logical.LogicalType[]accumulatorTypesprotected org.apache.flink.table.types.logical.LogicalType[]aggResultTypesprotected longallowedLatenessprotected intinputCountIndexprotected org.apache.flink.table.types.logical.LogicalType[]inputFieldTypesprotected booleanproduceUpdatesprotected introwtimeIndexprotected ZoneIdshiftTimeZoneprotected Trigger<?>triggerprotected GroupWindowAssigner<?>windowAssignerprotected org.apache.flink.table.types.logical.LogicalType[]windowPropertyTypes
-
Constructor Summary
Constructors Constructor Description WindowOperatorBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description WindowOperatorBuilder.AggregateWindowOperatorBuilderaggregate(GeneratedNamespaceAggsHandleFunction<?> generatedAggregateFunction, GeneratedRecordEqualiser generatedEqualiser, org.apache.flink.table.types.logical.LogicalType[] accumulatorTypes, org.apache.flink.table.types.logical.LogicalType[] aggResultTypes, org.apache.flink.table.types.logical.LogicalType[] windowPropertyTypes)WindowOperatorBuilder.TableAggregateWindowOperatorBuilderaggregate(GeneratedNamespaceTableAggsHandleFunction<?> generatedTableAggregateFunction, org.apache.flink.table.types.logical.LogicalType[] accumulatorTypes, org.apache.flink.table.types.logical.LogicalType[] aggResultTypes, org.apache.flink.table.types.logical.LogicalType[] windowPropertyTypes)WindowOperatorBuilder.AggregateWindowOperatorBuilderaggregate(NamespaceAggsHandleFunction<?> aggregateFunction, RecordEqualiser equaliser, org.apache.flink.table.types.logical.LogicalType[] accumulatorTypes, org.apache.flink.table.types.logical.LogicalType[] aggResultTypes, org.apache.flink.table.types.logical.LogicalType[] windowPropertyTypes)WindowOperatorBuilder.TableAggregateWindowOperatorBuilderaggregate(NamespaceTableAggsHandleFunction<?> tableAggregateFunction, org.apache.flink.table.types.logical.LogicalType[] accumulatorTypes, org.apache.flink.table.types.logical.LogicalType[] aggResultTypes, org.apache.flink.table.types.logical.LogicalType[] windowPropertyTypes)protected voidaggregate(org.apache.flink.table.types.logical.LogicalType[] accumulatorTypes, org.apache.flink.table.types.logical.LogicalType[] aggResultTypes, org.apache.flink.table.types.logical.LogicalType[] windowPropertyTypes)WindowOperatorBuilderassigner(GroupWindowAssigner<?> windowAssigner)static WindowOperatorBuilderbuilder()WindowOperatorBuildercountWindow(long size)WindowOperatorBuildercountWindow(long size, long slide)WindowOperatorBuildercumulative(Duration size, Duration step)WindowOperatorBuilderproduceUpdates()WindowOperatorBuildersession(Duration sessionGap)WindowOperatorBuildersliding(Duration size, Duration slide)WindowOperatorBuildertriggering(Trigger<?> trigger)WindowOperatorBuildertumble(Duration size)WindowOperatorBuilderwithAllowedLateness(Duration allowedLateness)WindowOperatorBuilderwithEventTime(int rowtimeIndex)WindowOperatorBuilderwithInputCountIndex(int inputCountIndex)The index of COUNT(*) in the aggregates. -1 when the input doesn't * contain COUNT(*), i.e.WindowOperatorBuilderwithInputFields(org.apache.flink.table.types.logical.LogicalType[] inputFieldTypes)WindowOperatorBuilderwithProcessingTime()WindowOperatorBuilderwithShiftTimezone(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.
-
-
-
Field Detail
-
inputFieldTypes
protected org.apache.flink.table.types.logical.LogicalType[] inputFieldTypes
-
windowAssigner
protected GroupWindowAssigner<?> windowAssigner
-
trigger
protected Trigger<?> trigger
-
accumulatorTypes
protected org.apache.flink.table.types.logical.LogicalType[] accumulatorTypes
-
aggResultTypes
protected org.apache.flink.table.types.logical.LogicalType[] aggResultTypes
-
windowPropertyTypes
protected org.apache.flink.table.types.logical.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(org.apache.flink.table.types.logical.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(org.apache.flink.table.types.logical.LogicalType[] accumulatorTypes, org.apache.flink.table.types.logical.LogicalType[] aggResultTypes, org.apache.flink.table.types.logical.LogicalType[] windowPropertyTypes)
-
aggregate
public WindowOperatorBuilder.AggregateWindowOperatorBuilder aggregate(NamespaceAggsHandleFunction<?> aggregateFunction, RecordEqualiser equaliser, org.apache.flink.table.types.logical.LogicalType[] accumulatorTypes, org.apache.flink.table.types.logical.LogicalType[] aggResultTypes, org.apache.flink.table.types.logical.LogicalType[] windowPropertyTypes)
-
aggregate
public WindowOperatorBuilder.AggregateWindowOperatorBuilder aggregate(GeneratedNamespaceAggsHandleFunction<?> generatedAggregateFunction, GeneratedRecordEqualiser generatedEqualiser, org.apache.flink.table.types.logical.LogicalType[] accumulatorTypes, org.apache.flink.table.types.logical.LogicalType[] aggResultTypes, org.apache.flink.table.types.logical.LogicalType[] windowPropertyTypes)
-
aggregate
public WindowOperatorBuilder.TableAggregateWindowOperatorBuilder aggregate(NamespaceTableAggsHandleFunction<?> tableAggregateFunction, org.apache.flink.table.types.logical.LogicalType[] accumulatorTypes, org.apache.flink.table.types.logical.LogicalType[] aggResultTypes, org.apache.flink.table.types.logical.LogicalType[] windowPropertyTypes)
-
aggregate
public WindowOperatorBuilder.TableAggregateWindowOperatorBuilder aggregate(GeneratedNamespaceTableAggsHandleFunction<?> generatedTableAggregateFunction, org.apache.flink.table.types.logical.LogicalType[] accumulatorTypes, org.apache.flink.table.types.logical.LogicalType[] aggResultTypes, org.apache.flink.table.types.logical.LogicalType[] windowPropertyTypes)
-
-