Transformations:
foldbykey() same as fold, with zero value with the data type to be returned.
groupbykey() grouping all data of same key.
*** rdd.reduceByKey(func)
produces the same RDD as rdd.groupBy
Key().mapValues(value => value.reduce(func))
but is more
efficient as it avoids the step of creating a list of values for each key.
sortbykey()
Custom sort order in Python, sorting integers as if strings
rdd.sortByKey(ascending=True, numPartitions=None, keyfunc = lambda x: str(x))