zipRDD,RDD,RDD-method {SparkR} | R Documentation |
Zips this RDD with another one, returning key-value pairs with the first element in each RDD second element in each RDD, etc. Assumes that the two RDDs have the same number of partitions and the same number of elements in each partition (e.g. one was made through a map on the other).
## S4 method for signature 'RDD,RDD' zipRDD(x, other) zipRDD(x, other)
x |
An RDD to be zipped. |
other |
Another RDD to be zipped. |
An RDD zipped from the two RDDs.
## Not run:
##D sc <- sparkR.init()
##D rdd1 <- parallelize(sc, 0:4)
##D rdd2 <- parallelize(sc, 1000:1004)
##D collect(zipRDD(rdd1, rdd2))
##D # list(list(0, 1000), list(1, 1001), list(2, 1002), list(3, 1003), list(4, 1004))
## End(Not run)