applying where after group by in dataset

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

applying where after group by in dataset

subashbasnet
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
Reply | Threaded
Open this post in threaded view
|

Re: applying where after group by in dataset

Jark Wu
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 <[hidden email]> 写道:

here