Re: Getting Key from keyBy() in ProcessFunction

2018-02-05 Thread Piotr Nowojski
I think now it’s not easily possible, however it might be a valid suggestion to add `OnTimerContext#getCurrentKey()` method. Besides using ValueState as you discussed before, as a some kind of a walk around you could copy and modify KeyedProcessOperator to suits your needs, but this would be m

Re: Getting Key from keyBy() in ProcessFunction

2018-02-04 Thread Ken Krugler
Hi Jürgen, That makes sense to me. Anyone from the Flink team want to comment on (a) if there is a way to get the current key in the timer callback without using an explicit ValueState that’s maintained in the processElement() method, and (b) if not, whether that could be added to the context?

Re: Getting Key from keyBy() in ProcessFunction

2018-02-04 Thread Jürgen Thomann
Hi Ken, thanks for your answer. You're right and I'm doing it already that way. I just hoped that I could avoid the ValueState (I'm using a MapState as well already, which does not store the key) and get the key from the provided Context of the ProcessFunction. This would avoid having the Val

Re: Getting Key from keyBy() in ProcessFunction

2018-02-02 Thread Ken Krugler
Hi Jürgen, > On Feb 2, 2018, at 6:24 AM, Jürgen Thomann > wrote: > > Hi, > > I'm currently using a ProcessFunction after a keyBy() and can't find a way to > get the key. Doesn’t your keyBy() take a field (position, or name) to use as the key? So then tha

Getting Key from keyBy() in ProcessFunction

2018-02-02 Thread Jürgen Thomann
Hi, I'm currently using a ProcessFunction after a keyBy() and can't find a way to get the key. I'm currently storing it in a ValueState within processElement and set it all the time, so that I can access it in onTimer(). Is there a better way to get the key? We are using Flink 1.3 at the mome