2021年4月10日星期六

Spark RDD find ratio of for key-value pairs

My rdd contains key-value pairs such as this: (key1, 5), (key2, 10), (key3, 20),

I want to perform a map operation that associates each key with its respect ratio in the entire rdd, such as this: (key1, 5/35), (key2, 10/35), (key3, 20/35),

I am struggling to find a method to do this using standard functions, any help will be appreciated.

https://stackoverflow.com/questions/67041367/spark-rdd-find-ratio-of-for-key-value-pairs April 11, 2021 at 12:06PM

没有评论:

发表评论