Finding Percentile in Spark-Scala per a group

前端 未结 2 1354
情深已故
情深已故 2020-12-06 15:29

I am trying to do a percentile over a column using a Window function as below. I have referred here to use the ApproxQuantile definition over a group.



        
2条回答
  •  再見小時候
    2020-12-06 16:03

    percentile_approx takes percentage and accuracy. It seems, they both must be a constant literal. Thus we can't compute the percentile_approx at runtime with dynamically calculated percentage and accuracy.

    ref- apache spark git percentile_approx source

提交回复
热议问题