We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0e9009c commit f8d6273Copy full SHA for f8d6273
python/pyspark/rdd.py
@@ -1327,11 +1327,13 @@ def groupWith(self, other, *others):
1327
"""
1328
Alias for cogroup but with support for multiple RDDs.
1329
1330
+ >>> w = sc.parallelize([("a", 5), ("b", 6)])
1331
>>> x = sc.parallelize([("a", 1), ("b", 4)])
1332
>>> y = sc.parallelize([("a", 2)])
1333
>>> z = sc.parallelize([("b", 42)])
- >>> map((lambda (x,y): (x, (list(y[0]), list(y[1]), list(y[2])))), sorted(list(x.groupWith(y, z).collect())))
1334
- [('a', ([1], [2], [])), ('b', ([4], [], [42]))]
+ >>> map((lambda (x,y): (x, (list(y[0]), list(y[1]), list(y[2]), list(y[3])))), \
1335
+ sorted(list(w.groupWith(x, y, z).collect())))
1336
+ [('a', ([5], [1], [2], [])), ('b', ([6], [4], [], [42]))]
1337
1338
1339
return python_cogroup((self, other) + others, numPartitions=None)
0 commit comments