pip install dpark
dpark <your_program.py>
python
from dpark import DparkContext
def square(x):
return x**2
if __name__ == "__main__":
dpark_context = DparkContext()
data = [1, 2, 3, 4, 5]
rdd = dpark_context.makeRDD(data)
result = rdd.map(square).reduce(lambda a, b: a + b)
print("The sum of squares is:", result)