Spark API Programming Hands-on 04-to implement the Union, Groupbyke in the Spark 1.2 release

Source: Internet
Author: User

Below is a look at the use of Union:


Use the collect operation to see the results of the execution:



Then look at the use of Groupbykey:


Execution Result:



The join operation is the process of a Cartesian product operation, as shown in the following example:



To perform a join operation on RDD3 and RDD4:



Use collect to view execution results:



It can be seen that the join operation is exactly a Cartesian product operation;

The reduce itself, which is an action-type operation in an RDD operation, causes the job to be committed and executed:



Let's look at the use of the lookup:


Execution Result:


Spark API Programming Hands-on 04-to implement the Union, Groupbyke in the Spark 1.2 release

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.