本文簡要介紹
pyspark.RDD.join
的用法。用法:
RDD.join(other, numPartitions=None)
返回一個 RDD,其中包含
self
和other
中具有匹配鍵的所有元素對。每對元素將作為 (k, (v1, v2)) 元組返回,其中 (k, v1) 在
self
中, (k, v2) 在other
中。跨集群執行散列連接。
例子:
>>> x = sc.parallelize([("a", 1), ("b", 4)]) >>> y = sc.parallelize([("a", 2), ("a", 3)]) >>> sorted(x.join(y).collect()) [('a', (1, 2)), ('a', (1, 3))]
相關用法
- Python pyspark RDD.saveAsTextFile用法及代碼示例
- Python pyspark RDD.keyBy用法及代碼示例
- Python pyspark RDD.sumApprox用法及代碼示例
- Python pyspark RDD.lookup用法及代碼示例
- Python pyspark RDD.zipWithIndex用法及代碼示例
- Python pyspark RDD.sampleByKey用法及代碼示例
- Python pyspark RDD.coalesce用法及代碼示例
- Python pyspark RDD.subtract用法及代碼示例
- Python pyspark RDD.count用法及代碼示例
- Python pyspark RDD.groupWith用法及代碼示例
- Python pyspark RDD.distinct用法及代碼示例
- Python pyspark RDD.treeAggregate用法及代碼示例
- Python pyspark RDD.mapPartitionsWithIndex用法及代碼示例
- Python pyspark RDD.foreachPartition用法及代碼示例
- Python pyspark RDD.zipWithUniqueId用法及代碼示例
- Python pyspark RDD.sortByKey用法及代碼示例
- Python pyspark RDD.takeOrdered用法及代碼示例
- Python pyspark RDD.collectAsMap用法及代碼示例
- Python pyspark RDD.countApproxDistinct用法及代碼示例
- Python pyspark RDD.toLocalIterator用法及代碼示例
- Python pyspark RDD.reduceByKeyLocally用法及代碼示例
- Python pyspark RDD.max用法及代碼示例
- Python pyspark RDD.map用法及代碼示例
- Python pyspark RDD.partitionBy用法及代碼示例
- Python pyspark RDD.stdev用法及代碼示例
注:本文由純淨天空篩選整理自spark.apache.org大神的英文原創作品 pyspark.RDD.join。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。