Class KeyByKeySelector

    • Constructor Detail

      • KeyByKeySelector

        public KeyByKeySelector()
    • 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 interface KeySelector<Row,​Row>
        Parameters:
        value - The object to get the key from.
        Returns:
        The extracted key.