Member since
04-25-2016
4
Posts
0
Kudos Received
0
Solutions
04-29-2016
06:32 AM
Thanks! Yes percent_rank() and window function together did the trick. A different way is to sort the column and pick the one that is in the middle. The results are close.
... View more
04-25-2016
12:19 PM
Hello! I was trying to use spark to calculate median on grouped values in a dataframe, but have not had much success. I have tried using agg(), but median() is not available; tried to apply rank() to window function but the rank was not grouped; also tried to pivot the table to avoid the grouped step but the data frame is huge (8million rows) and it fails multiple times. Calculating median should be something straightforward to do since data analysts use it a lot. Maybe I'm missing something obvious? Thanks!!
... View more
Labels:
- Labels:
-
Apache Spark