You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by Tony Lane <to...@gmail.com> on 2016/07/30 18:30:10 UTC

how to order data in descending order in spark dataset

ts.groupBy("b").count().orderBy("count");

how can I order this data in descending order of count
Any suggestions

-Tony

Re: how to order data in descending order in spark dataset

Posted by Mark Wusinich <ma...@gmail.com>.
> ts.groupBy("b").count().orderBy(col("count"), ascending=False)

Sent from my iPhone

> On Jul 30, 2016, at 2:54 PM, Don Drake <do...@gmail.com> wrote:
> 
> Try:
> 
> ts.groupBy("b").count().orderBy(col("count").desc());
> 
> -Don
> 
>> On Sat, Jul 30, 2016 at 1:30 PM, Tony Lane <to...@gmail.com> wrote:
>> just to clarify I am try to do this in java
>> 
>> ts.groupBy("b").count().orderBy("count");
>> 
>> 
>> 
>>> On Sun, Jul 31, 2016 at 12:00 AM, Tony Lane <to...@gmail.com> wrote:
>>> ts.groupBy("b").count().orderBy("count");
>>> 
>>> how can I order this data in descending order of count
>>> Any suggestions
>>> 
>>> -Tony 
> 
> 
> 
> -- 
> Donald Drake
> Drake Consulting
> http://www.drakeconsulting.com/
> https://twitter.com/dondrake
> 800-733-2143

Re: how to order data in descending order in spark dataset

Posted by Don Drake <do...@gmail.com>.
Try:

ts.groupBy("b").count().orderBy(col("count").desc());

-Don

On Sat, Jul 30, 2016 at 1:30 PM, Tony Lane <to...@gmail.com> wrote:

> just to clarify I am try to do this in java
>
> ts.groupBy("b").count().orderBy("count");
>
>
>
> On Sun, Jul 31, 2016 at 12:00 AM, Tony Lane <to...@gmail.com>
> wrote:
>
>> ts.groupBy("b").count().orderBy("count");
>>
>> how can I order this data in descending order of count
>> Any suggestions
>>
>> -Tony
>>
>
>


-- 
Donald Drake
Drake Consulting
http://www.drakeconsulting.com/
https://twitter.com/dondrake <http://www.MailLaunder.com/>
800-733-2143

Re: how to order data in descending order in spark dataset

Posted by Tony Lane <to...@gmail.com>.
just to clarify I am try to do this in java

ts.groupBy("b").count().orderBy("count");



On Sun, Jul 31, 2016 at 12:00 AM, Tony Lane <to...@gmail.com> wrote:

> ts.groupBy("b").count().orderBy("count");
>
> how can I order this data in descending order of count
> Any suggestions
>
> -Tony
>