Created
July 6, 2018 12:48
-
-
Save koushikmln/6d183f87ed3613336510b6e48aed712d to your computer and use it in GitHub Desktop.
Spark Example to Give Count of Orders By Status
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rdd = sc.textFile("/public/retail_db/orders/part-00000") | |
status_count = rdd.map(lambda x: (x.split(",")[3], 1)) | |
.reduceByKey(lambda a,b: a + b).collect() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment