RDD conversion operation-RDD conversion process

Source: Internet
Author: User

1) Union (otherrdd)
RDD --> unionrdd
2) groupbykey (numpartitions)
RDD --> shuffledrdd --> mappartitionsrdd
Groupbykey () only needs to aggregate the records with the same key to complete a simple shuffle process.
3) performanceybykey (func, numpartitions)
Reduceybykey () is equivalent to the traditional mapreduce
RDD --> mappartitionsrdd --> shuffledrdd --> mappartitionsrdd
4) distinct (numpartitions)
RDD --> mappedrdd --> mappartitionsrdd --> shuffledrdd --> mappartitionsrdd
The distinct () function is used to repeat all data in deduplicate RDD.
5) cogroup (otherrdd, numpartitions)
RDD --> cogrouprdd --> mappartitionsrdd
Unlike groupbykey (), cogroup () requires two or more RDD
6) intersection (otherrdd)
RDD --> mappedrdd --> cogrouprdd --> mappedvaluesrdd --> filteredrdd --> mappedrdd
The intersection () function extracts public data from rdd a and rdd B.
7) join (otherrdd, numpartitions)
RDD --> cogrouprdd --> mappedvaluesrdd --> flatmappedvaluesrdd
Join () aggregates two RDDs [(k, v)] In the join mode in SQL.
8) sortbykey (ascending, numpartitions)
RDD --> shuffledrdd --> mappartitionsrdd
Sortbykey () sorts the records in RDD [(k, v)] by key. ascending = true indicates ascending order, and false indicates descending order.
9) Cartesian (otherrdd)
RDD --> cartesianrdd
Cartesian performs Cartesian sets on two RDD instances. The number of partitions in the generated cartesianrdd is partitionnum (rdd a) * partitionnum (rdd B ).

RDD conversion operation-RDD conversion process

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.