Github user gyfora commented on the pull request:
https://github.com/apache/flink/pull/1831#issuecomment-200907475
@StephanEwen
This PR does not change the behaviour of any existing Flink applications.
It now allows though that users only specify key of one input of the
comapfunctions for instance:
`input1.keyBy(...).connect(input2.broadcast())`
This was previously impossible which probably blocks many existing
use-cases (actually blocking one of my own applications that I try to build on
Flink) where one input does not have associated state.
After this change the key-value state defined by the keyed input stream
works as expected.
The only not so fortunate behaviour is that users can still call
state.value() for inputs from the non-keyed stream and the behaviour is not
clearly defined. If there was already input from the other side it returns the
state for the last key, otherwise it will probably throw a nullpointer
exception.
I think this is acceptable behaviour for the time being because well
written programs will work as expected. We can think about how we want to
handle the other non-keyed input but that will probably include changing many
things in the KvBackends so they can do this properly. This problem already
exists in flink as state access outside of the processing method is not well
defined.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---