pyflink.datastream.data_stream.DataStream.key_by#
- DataStream.key_by(key_selector: Callable | KeySelector, key_type: TypeInformation | None = None) KeyedStream[source]#
Creates a new KeyedStream that uses the provided key for partitioning its operator states.
- Parameters:
key_selector – The KeySelector to be used for extracting the key for partitioning.
key_type – The type information describing the key type.
- Returns:
The DataStream with partitioned state(i.e. KeyedStream).