public class ExpressionFilterFunction<T> extends RichFilterFunction<T>
filter()
are forwarded to the compiled code.Constructor and Description |
---|
ExpressionFilterFunction(Expression predicate,
CompositeType<T> inputType,
TableConfig config) |
Modifier and Type | Method and Description |
---|---|
FilterFunction<T> |
compiledFilter() |
boolean |
filter(T in)
The filter function that evaluates the predicate.
|
void |
open(Configuration c)
Initialization method for the function.
|
close, getIterationRuntimeContext, getRuntimeContext, setRuntimeContext
public ExpressionFilterFunction(Expression predicate, CompositeType<T> inputType, TableConfig config)
public FilterFunction<T> compiledFilter()
public void open(Configuration c)
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
c
- The configuration containing the parameters attached to the contract.Configuration
public boolean filter(T in)
FilterFunction
IMPORTANT: The system assumes that the function does not modify the elements on which the predicate is applied. Violating this assumption can lead to incorrect results.
filter
in interface FilterFunction<T>
filter
in class RichFilterFunction<T>
in
- The value to be filtered.Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.