Hi Ayan,

Thanks for help,

Your example is not the streaming example. There we don't have sortByKey.



On Wed, Nov 11, 2015 at 11:35 PM, ayan guha <[email protected]> wrote:

> how about this?
>
> sorted = running_counts.map(lambda t: t[1],t[0]).sortByKey()
>
> Basically swap key and value of the RDD and then sort?
>
> On Thu, Nov 12, 2015 at 8:53 AM, Amir Rahnama <[email protected]>
> wrote:
>
>> Hey,
>>
>> Anybody knows how can one sort the result in the stateful example?
>>
>> Python would be prefered.
>>
>>
>> https://github.com/apache/spark/blob/859dff56eb0f8c63c86e7e900a12340c199e6247/examples/src/main/python/streaming/stateful_network_wordcount.py
>> --
>> Thanks and Regards,
>>
>> Amir Hossein Rahnama
>>
>> *Tel: +46 (0) 761 681 102*
>> Website: www.ambodi.com
>> Twitter: @_ambodi <https://twitter.com/_ambodi>
>>
>
>
>
> --
> Best Regards,
> Ayan Guha
>



-- 
Thanks and Regards,

Amir Hossein Rahnama

*Tel: +46 (0) 761 681 102*
Website: www.ambodi.com
Twitter: @_ambodi <https://twitter.com/_ambodi>

Reply via email to