Spark IMF legendary Action 17th lesson Transformations Combat Summary

Source: Internet
Author: User

This evening, I listened to Liaoliang, the 17th lesson of the IMF Legend Action Transformations, which was written in Scala Cogroup:

def main (args:array[string]): Unit ={val sc= Sparkcontext ("Transformations") Cogrouptrans (SC) sc.stop ()}def Cogrouptrans (sc:sparkcontext): Unit={val Stunames=Array (Tuple2 (1, "Spark"), Tuple2 (2, "TECC"), Tuple2 (3, "Hadoop")) Val stuscores=Array (Tuple2 (1,100), Tuple2 (1,99), Tuple2 (2,95), Tuple2 (3,65)) Val names=sc.parallelize (Stunames) Val scores=sc.parallelize (stuscores) Val Stunameandscore=Names.cogroup (scores) Stunameandscore.collect (). foreach (println)}

Follow-up courses can be referred to Sina Weibo Liaoliang _dt Big Data Dream Factory: Http://weibo.com/ilovepains

Liaoliang China Spark First person, public number Dt_spark

Forward please specify the source.

Spark IMF legendary Action 17th lesson Transformations Combat Summary

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.