Re: Keeping only latest row by key?

2018-07-19 Thread Fabian Hueske
.groupBy("id") > > .sortGroup("timestamp", Order.DESCENDING) > > .first(1); > > > > Is there anything I’ve misunderstood with this? > > > > *From:* Porritt, James > *Sent:* 19 July 2018 09:21 > *To:* 'Timo Walther' >

RE: Keeping only latest row by key?

2018-07-19 Thread Porritt, James
this? From: Porritt, James Sent: 19 July 2018 09:21 To: 'Timo Walther' Cc: user@flink.apache.org Subject: RE: Keeping only latest row by key? Hi Timo, Thanks for this. I’ve been looking into creating this in Java by looking at MaxAggFunction.scala as a basis. Is it correct t

RE: Keeping only latest row by key?

2018-07-19 Thread Porritt, James
with the correct type of table field? Thanks, James. From: Timo Walther Sent: 18 July 2018 12:21 To: Porritt, James Cc: user@flink.apache.org Subject: Re: Keeping only latest row by key? Hi James, the easiest solution for this bahavior is to use a user-defined LAST_VALUE aggregate function

Re: Keeping only latest row by key?

2018-07-18 Thread Timo Walther
Hi James, the easiest solution for this bahavior is to use a user-defined LAST_VALUE aggregate function as discussed here [1]. I hope this helps. Regards, Timo [1]

Re: Keeping only latest row by key?

2018-07-18 Thread Andrey Zagrebin
Hi James, There are over windows in Flink Table API: https://ci.apache.org/projects/flink/flink-docs-release-1.5/dev/table/tableApi.html#over-windows It should be possible to implement this