Class KeyByKeySelector
- java.lang.Object
-
- org.apache.flink.streaming.api.functions.python.KeyByKeySelector
-
- All Implemented Interfaces:
Serializable
,Function
,KeySelector<Row,Row>
@Internal public class KeyByKeySelector extends Object implements KeySelector<Row,Row>
KeyByKeySelector
is responsible for extracting the first field of the input row as key. The input row is generated by python DataStream map function in the format of (key_selector.get_key(value), value) tuple2.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description KeyByKeySelector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Row
getKey(Row value)
User-defined function that deterministically extracts the key from an object.
-
-
-
Method Detail
-
getKey
public Row getKey(Row value)
Description copied from interface:KeySelector
User-defined function that deterministically extracts the key from an object.For example for a class:
public class Word { String word; int count; }
The key extractor could return the word as a key to group all Word objects by the String they contain.
The code would look like this
public String getKey(Word w) { return w.word; }
- Specified by:
getKey
in interfaceKeySelector<Row,Row>
- Parameters:
value
- The object to get the key from.- Returns:
- The extracted key.
-
-