In the example, the map method shows to take a lambda with two parameters (key and xy), but it appears as though the python version of spark only has a map method that expects a lambda with just a single parameter.
So instead of the following
r = sumCount.map(lambda key, xy: (key, xy[0]/xy[1])).collectAsMap()
In the example, the
map
method shows to take alambda
with two parameters (key
andxy
), but it appears as though the python version of spark only has amap
method that expects a lambda with just a single parameter.So instead of the following
We should use