public class KeySelectorWithType<IN,K> extends Object implements KeySelector<IN,K>, ResultTypeQueryable<K>
Constructor and Description |
---|
KeySelectorWithType(scala.Function1<IN,K> fun,
TypeInformation<K> info) |
Modifier and Type | Method and Description |
---|---|
K |
getKey(IN value)
User-defined function that deterministically extracts the key from an object.
|
TypeInformation<K> |
getProducedType()
Gets the data type (as a
TypeInformation ) produced by this function or input format. |
public KeySelectorWithType(scala.Function1<IN,K> fun, TypeInformation<K> info)
public K getKey(IN value)
KeySelector
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; }
getKey
in interface KeySelector<IN,K>
value
- The object to get the key from.public TypeInformation<K> getProducedType()
ResultTypeQueryable
TypeInformation
) produced by this function or input format.getProducedType
in interface ResultTypeQueryable<K>
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.