You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by subash basnet <ya...@gmail.com> on 2016/08/17 09:29:44 UTC

applying where after group by in dataset

Hello all,

In the following dataset:
DataSet<Tuple2<Point, Boolean>> distancePoints;

I wanted to count the number of *distancePoints* where boolean value is
either true of false.

distancePoints.groupBy(1).........

didn't find how to apply there 'where' clause here.

Best Regards,
Subash Basnet

Re: applying where after group by in dataset

Posted by Jark Wu <wu...@alibaba-inc.com>.
Hi,

You can only apply aggregate after groupBy. But you can apply filter before groupBy.

So you can do like this:  

distancePoints.filter(filterFunction).groupBy(1)


- Jark Wu 

> 在 2016年8月17日,下午5:29,subash basnet <ya...@gmail.com> 写道:
> 
> here