Re: Table API and ProcessWindowFunction

2019-07-11 Thread Hequn Cheng
Hi Flavio, I think the reason that we don't have interfaces like EventTimeObject and ProcessingTimeObject is we don't want to define time attributes anywhere. It is considered to define your time attributes in the source. If we add an interface like EventTimeObject and ProcessingTimeObject in Flin

Re: Table API and ProcessWindowFunction

2019-07-11 Thread Flavio Pompermaier
Only one proposal here: many times it happens that when working with streaming sources you need to define which field is the processing/row. Right now you could define the processing or event time field implementingthe DefinedProctimeAttribute or DefinedRowtimeAttribute at source. But this is only

Re: Table API and ProcessWindowFunction

2019-07-11 Thread Flavio Pompermaier
Thanks Hequn, I'll give it a try! Best, Flavio On Thu, Jul 11, 2019 at 3:38 AM Hequn Cheng wrote: > Hi, > > > Can you provide a pseudo-code example of how to implement this? > Processing time > If you use a TumblingProcessingTimeWindows.of(Time.seconds(1)), for each > record, you get the timest

Re: Table API and ProcessWindowFunction

2019-07-10 Thread Hequn Cheng
Hi, > Can you provide a pseudo-code example of how to implement this? Processing time If you use a TumblingProcessingTimeWindows.of(Time.seconds(1)), for each record, you get the timestamp from System.currentTimeMillis(), say t, and w_start = TimeWindow.getWindowStartWithOffset(t, 0, 1000), and w_

Re: Table API and ProcessWindowFunction

2019-07-10 Thread Flavio Pompermaier
The problem with the LATERAL JOIN (via a LookupableTableSource+TableFunction because I need to call that function using the userId a a parameter) is that I cannot know the window start/end..to me it's not clear how to get that from TimeWindow.getWindowStartWithOffset(timestamp, offset, windowSize)

Re: Table API and ProcessWindowFunction

2019-07-08 Thread Hequn Cheng
Hi Flavio, Thanks for your information. >From your description, it seems that you only use the window to get the start and end time. There are no aggregations happen. If this is the case, you can get the start and end time by yourself(the `TimeWindow.getWindowStartWithOffset()` shows how to get w

Re: Table API and ProcessWindowFunction

2019-07-08 Thread Flavio Pompermaier
Hi Hequn, thanks for your answer. What I'm trying to do is to read a stream of events that basically contains a UserId field and, every X minutes (i.e. using a Time Window) and for each different UserId key, query 3 different REST services to enrich my POJOs*. For the moment what I do is to use a P

Re: Table API and ProcessWindowFunction

2019-07-08 Thread Hequn Cheng
Hi Flavio, Nice to hear your ideas on Table API! Could you be more specific about your requirements? A detailed scenario would be quite helpful. For example, do you want to emit multi records through the collector or do you want to use the timer? BTW, Table API introduces flatAggregate recently(

Table API and ProcessWindowFunction

2019-07-08 Thread Flavio Pompermaier
Hi to all, from what I understood a ProcessWindowFunction can only be used in the Streaming API. Is there any plan to port them also in the Table API (in the near future)? I'd like to do with Table API the equivalent of: final DataStream events = env.addSource(src); events.filter(e -> e.getCode()