public class DataSetTumbleTimeWindowAggReduceCombineFunction extends DataSetTumbleTimeWindowAggReduceGroupFunction implements CombineFunction<Row,Row>
GroupReduceOperator
and
GroupCombineOperator
.
It is used for tumbling time-window on batch.
param: genPreAggregations Code-generated GeneratedAggregations
for partial aggs.
param: genFinalAggregations Code-generated GeneratedAggregations
for final aggs.
param: windowSize Tumbling time window size
param: windowStartPos The relative window-start field position to the last field of
output row
param: windowEndPos The relative window-end field position to the last field of
output row
param: keysAndAggregatesArity The total arity of keys and aggregates
Constructor and Description |
---|
DataSetTumbleTimeWindowAggReduceCombineFunction(GeneratedAggregationsFunction genPreAggregations,
GeneratedAggregationsFunction genFinalAggregations,
long windowSize,
scala.Option<Object> windowStartPos,
scala.Option<Object> windowEndPos,
int keysAndAggregatesArity) |
Modifier and Type | Method and Description |
---|---|
Row |
combine(Iterable<Row> records)
For sub-grouped intermediate aggregate Rows, merge all of them into aggregate buffer,
|
void |
open(Configuration config)
Initialization method for the function.
|
protected GeneratedAggregations |
preAggfunction() |
accumulators, aggregateBuffer, function, reduce
close, getIterationRuntimeContext, getRuntimeContext, setRuntimeContext
public DataSetTumbleTimeWindowAggReduceCombineFunction(GeneratedAggregationsFunction genPreAggregations, GeneratedAggregationsFunction genFinalAggregations, long windowSize, scala.Option<Object> windowStartPos, scala.Option<Object> windowEndPos, int keysAndAggregatesArity)
protected GeneratedAggregations preAggfunction()
public void open(Configuration config)
RichFunction
The configuration object passed to the function can be used for configuration and initialization. The configuration contains all parameters that were configured on the function in the program composition.
public class MyMapper extends FilterFunction<String> {
private String searchString;
public void open(Configuration parameters) {
this.searchString = parameters.getString("foo");
}
public boolean filter(String value) {
return value.equals(searchString);
}
}
By default, this method does nothing.
open
in interface RichFunction
open
in class DataSetTumbleTimeWindowAggReduceGroupFunction
config
- The configuration containing the parameters attached to the contract.Configuration
public Row combine(Iterable<Row> records)
combine
in interface CombineFunction<Row,Row>
records
- Sub-grouped intermediate aggregate Rows iterator.Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.