Find median in spark SQL for multiple double datatype columns
问题 I have a requirement to find median for multiple double datatype columns.Request suggestion to find the correct approach. Below is my sample dataset with one column. I am expecting the median value to be returned as 1 for my sample. scala> sqlContext.sql("select num from test").show(); +---+ |num| +---+ |0.0| |0.0| |1.0| |1.0| |1.0| |1.0| +---+ I tried the following options 1) Hive UDAF percentile, it worked only for BigInt. 2) Hive UDAT percentile_approx, but it does not work as expected