Last active
August 29, 2015 14:05
-
-
Save okaram/66e85c2b08d1fbd79c53 to your computer and use it in GitHub Desktop.
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
sales=sc.textFile("sales_*.txt").map(lambda x:x.split('\t')) |
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
2014-01-01 1 1 100 | |
2014-01-01 1 2 37 | |
2014-01-01 1 3 54 | |
2014-01-01 2 1 50 | |
2014-01-01 2 2 40 | |
2014-01-01 3 1 75 |
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
sales_by_product=sales.map(lambda x : (x[0],int(x[2])) ).reduceByKey(lambda x,y:x+y) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment