Created
December 13, 2016 00:00
-
-
Save milindjagre/6ec99198782e0061be3b918eef809432 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
from pyspark import SparkConf, SparkContext | |
conf = SparkConf().setMaster("local").setAppName("Sum") | |
sc = SparkContext(conf = conf) | |
numbers = sc.parallelize([1, 2, 3, 4, 5]) | |
sum = numbers.reduce(lambda x, y: x + y) | |
print "--------------" | |
print "SUM IS :", sum | |
print "--------------" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This python file is used for performing addition operation with the help of the reduce action