Class SelectByMinFunction<T extends org.apache.flink.api.java.tuple.Tuple>
- java.lang.Object
-
- org.apache.flink.api.java.functions.SelectByMinFunction<T>
-
- Type Parameters:
T-
- All Implemented Interfaces:
Serializable,org.apache.flink.api.common.functions.Function,org.apache.flink.api.common.functions.ReduceFunction<T>
@Internal public class SelectByMinFunction<T extends org.apache.flink.api.java.tuple.Tuple> extends Object implements org.apache.flink.api.common.functions.ReduceFunction<T>
Function that enables selection by minimal value of a field.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SelectByMinFunction(org.apache.flink.api.java.typeutils.TupleTypeInfo<T> type, int... fields)Constructor which is overwriting the default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Treduce(T value1, T value2)Reduce implementation, returns smaller tuple or value1 if both tuples are equal.
-
-
-
Constructor Detail
-
SelectByMinFunction
public SelectByMinFunction(org.apache.flink.api.java.typeutils.TupleTypeInfo<T> type, int... fields)
Constructor which is overwriting the default constructor.- Parameters:
type- Types of tuple whether to check if given fields are key types.fields- Array of integers which are used as key for comparison. The order of indexes is regarded in the reduce function. First index has highest priority and last index has least priority.
-
-
Method Detail
-
reduce
public T reduce(T value1, T value2) throws Exception
Reduce implementation, returns smaller tuple or value1 if both tuples are equal. Comparison highly depends on the order and amount of fields chosen as indices. All given fields (at construction time) are checked in the same order as defined (at construction time). If both tuples are equal in one index, the next index is compared. Or if no next index is available value1 is returned. The tuple which has a smaller value at one index will be returned.
-
-