pyspark RDD reduce、reduceByKey、reduceByKeyLocally用法
一、reduceReducestheelementsofthisRDDusingthespecifiedcommutativeandassociativebinaryoperator.Currentlyreducespartitionslocally.a=sc.parallelize([1,2,3,4,5],2).reduce(add)print(a)a=sc.parallelize((2for_