> Hi,
> 
> My req is to find max value of revenue per customer so I am using below 
> query. I got this solution from one of tutorial in google but not able to 
> understand how it returns max in this scenario. can anyone hep
> 
> revenuePerDayPerCustomerMap.reduceByKey((x, y) => (if(x._2 >= y._2) x else y))
> 
>  ((2013-12-27 00:00:00.0),(62962,199.98))
>  ((2013-12-27 00:00:00.0),(62962),299.98))
> 
> 
> why doesn't the below statement work to get max?
> 
> x._1>=y._1 ? btw, what is value of x._1,x._2,y._1,y._2 in this scenario. 
> 
> Thanks and waiting for your responses.
> 
> Regards,
> Asmath

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@spark.apache.org
For additional commands, e-mail: user-h...@spark.apache.org

Reply via email to