python pyspark-actions-transformations.py

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python pyspark-actions-transformations.py相关的知识,希望对你有一定的参考价值。

path = "/public/retail_db" or path = "/Users/itversity/Research/data/retail_db"
rdd = sc.textFile(path + "/orders")
rdd.reduce(lambda agg, ele: 
  agg if(int(agg.split(",")[2]) < int(ele.split(",")[2])) else ele
  )
rdd.top(2)
for i in rdd.takeOrdered(5, lambda x: -int(x.split(",")[2])): print(i)

以上是关于python pyspark-actions-transformations.py的主要内容,如果未能解决你的问题,请参考以下文章

Python代写,Python作业代写,代写Python,代做Python

Python开发

Python,python,python

Python 介绍

Python学习之认识python

python初识