Class GenericRowDataKeySelector
- java.lang.Object
-
- org.apache.flink.table.runtime.keyselector.GenericRowDataKeySelector
-
- All Implemented Interfaces:
Serializable
,Function
,KeySelector<RowData,RowData>
,ResultTypeQueryable<RowData>
,RowDataKeySelector
public class GenericRowDataKeySelector extends Object implements RowDataKeySelector
A KeySelector which will extract key from RowData. The key type is GenericRowData.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GenericRowDataKeySelector(InternalTypeInfo<RowData> keyRowType, RowDataSerializer keySerializer, GeneratedProjection generatedProjection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GenericRowDataKeySelector
copy()
RowData
getKey(RowData value)
User-defined function that deterministically extracts the key from an object.InternalTypeInfo<RowData>
getProducedType()
Gets the data type (as aTypeInformation
) produced by this function or input format.void
open()
-
-
-
Constructor Detail
-
GenericRowDataKeySelector
public GenericRowDataKeySelector(InternalTypeInfo<RowData> keyRowType, RowDataSerializer keySerializer, GeneratedProjection generatedProjection)
-
-
Method Detail
-
open
public void open()
-
getKey
public RowData getKey(RowData value) throws Exception
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<RowData,RowData>
- Parameters:
value
- The object to get the key from.- Returns:
- The extracted key.
- Throws:
Exception
- Throwing an exception will cause the execution of the respective task to fail, and trigger recovery or cancellation of the program.
-
getProducedType
public InternalTypeInfo<RowData> getProducedType()
Description copied from interface:ResultTypeQueryable
Gets the data type (as aTypeInformation
) produced by this function or input format.- Specified by:
getProducedType
in interfaceResultTypeQueryable<RowData>
- Specified by:
getProducedType
in interfaceRowDataKeySelector
- Returns:
- The data type produced by this function or input format.
-
copy
public GenericRowDataKeySelector copy()
-
-