Class WindowOperatorBuilder
java.lang.Object
org.apache.flink.table.runtime.operators.window.groupwindow.operator.WindowOperatorBuilder
The
WindowOperatorBuilder is used to build WindowOperator 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 ClassesModifier and TypeClassDescriptionstatic classThe builder which is used to buildAggregateWindowOperatorfluently.static classThe builder which is used to buildTableAggregateWindowOperatorfluently. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.flink.table.types.logical.LogicalType[]protected org.apache.flink.table.types.logical.LogicalType[]protected longprotected intprotected org.apache.flink.table.types.logical.LogicalType[]protected booleanprotected intprotected ZoneIdprotected Trigger<?>protected GroupWindowAssigner<?>protected org.apache.flink.table.types.logical.LogicalType[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaggregate(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(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) 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(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) assigner(GroupWindowAssigner<?> windowAssigner) static WindowOperatorBuilderbuilder()countWindow(long size) countWindow(long size, long slide) cumulative(Duration size, Duration step) triggering(Trigger<?> trigger) withAllowedLateness(Duration allowedLateness) withEventTime(int rowtimeIndex) withInputCountIndex(int inputCountIndex) The index of COUNT(*) in the aggregates. -1 when the input doesn't * contain COUNT(*), i.e.withInputFields(org.apache.flink.table.types.logical.LogicalType[] inputFieldTypes) 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.
-
Field Details
-
inputFieldTypes
protected org.apache.flink.table.types.logical.LogicalType[] inputFieldTypes -
windowAssigner
-
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
-
inputCountIndex
protected int inputCountIndex
-
-
Constructor Details
-
WindowOperatorBuilder
public WindowOperatorBuilder()
-
-
Method Details
-
builder
-
withInputFields
public WindowOperatorBuilder withInputFields(org.apache.flink.table.types.logical.LogicalType[] inputFieldTypes) -
withShiftTimezone
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
-
sliding
-
cumulative
-
session
-
countWindow
-
countWindow
-
assigner
-
triggering
-
withEventTime
-
withProcessingTime
-
withAllowedLateness
-
produceUpdates
-
withInputCountIndex
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)
-