public class ExpressionAggregateFunction extends RichGroupReduceFunction<Row,Row> implements GroupCombineFunction<Row,Row>
Constructor and Description |
---|
ExpressionAggregateFunction(scala.collection.Seq<Object> fieldPositions,
scala.collection.Seq<AggregationFunction<Object>> functions) |
Modifier and Type | Method and Description |
---|---|
void |
combine(Iterable<Row> in,
Collector<Row> out)
The combine method, called (potentially multiple timed) with subgroups of elements.
|
void |
open(Configuration conf)
Initialization method for the function.
|
void |
reduce(Iterable<Row> in,
Collector<Row> out)
The reduce method.
|
close, getIterationRuntimeContext, getRuntimeContext, setRuntimeContext
public ExpressionAggregateFunction(scala.collection.Seq<Object> fieldPositions, scala.collection.Seq<AggregationFunction<Object>> functions)
public void open(Configuration conf)
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
conf
- The configuration containing the parameters attached to the contract.Configuration
public void reduce(Iterable<Row> in, Collector<Row> out)
GroupReduceFunction
reduce
in interface GroupReduceFunction<Row,Row>
reduce
in class RichGroupReduceFunction<Row,Row>
in
- All records that belong to the given input key.out
- The collector to hand results to.public void combine(Iterable<Row> in, Collector<Row> out)
GroupCombineFunction
combine
in interface GroupCombineFunction<Row,Row>
in
- The elements to be combined.out
- The collector to use to return values from the function.Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.