Spark, Data Science, Tutorial, Machine Learning, Machine Intelligence.
.select("units") .stat.approxQuantile("units",Array(0.5),0.0001) .head; println("=================================="); println(median); println("===================================") } The above code will fetch median value. as the the value is from CVS data , type will be String unlike like sql