public class DataSetPreAggFunction extends AbstractRichFunction implements GroupCombineFunction<Row,Row>, MapPartitionFunction<Row,Row>, Compiler<GeneratedAggregations>, Logging
GroupCombineFunction
and MapPartitionFunction
to compute pre-aggregates for batch
(DataSet) queries.
param: genAggregations Code-generated GeneratedAggregations
Constructor and Description |
---|
DataSetPreAggFunction(GeneratedAggregationsFunction genAggregations) |
Modifier and Type | Method and Description |
---|---|
void |
combine(Iterable<Row> values,
Collector<Row> out)
The combine method, called (potentially multiple timed) with subgroups of elements.
|
void |
mapPartition(Iterable<Row> values,
Collector<Row> out)
A user-implemented function that modifies or transforms an incoming object.
|
void |
open(Configuration config)
Initialization method for the function.
|
close, getIterationRuntimeContext, getRuntimeContext, setRuntimeContext
public DataSetPreAggFunction(GeneratedAggregationsFunction genAggregations)
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 AbstractRichFunction
config
- The configuration containing the parameters attached to the contract.Configuration
public void combine(Iterable<Row> values, Collector<Row> out)
GroupCombineFunction
combine
in interface GroupCombineFunction<Row,Row>
values
- The elements to be combined.out
- The collector to use to return values from the function.public void mapPartition(Iterable<Row> values, Collector<Row> out)
MapPartitionFunction
mapPartition
in interface MapPartitionFunction<Row,Row>
values
- All records for the mapperout
- The collector to hand results to.Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.