quiz13-spark-solution.pdf - Name USC ID Quiz 13 Apache Spark(10 points 10 minutes 1[8 points Consider the following Spark code lines =

quiz13-spark-solution.pdf - Name USC ID Quiz 13 Apache...

This preview shows page 1 out of 1 page.

Name: ___________________________ USC ID: ______________________ INF 551, Spring 2017 Quiz 13: Apache Spark (10 points. 10 minutes) 1.[8 points] Consider the following Spark code: lines = sc.textFile(“hello.txt”)lines1 = lines.filter(lambda x: “reduce” in x)words = lines1.flatMap(lambda x: x.split(' ')) kvs = words.map(lambda x: (x, 1)) counts = kvs.reduceByKey(lambda x, y: x + y) Suppose the “hello.txt” file has the following 3 lines:map or reduce map and only map reduce after map What are the contents of these RDDs: lines, lines1, words, kvs, and counts ?
Image of page 1

You've reached the end of your free preview.

Want to read the whole page?

  • Fall '14
  • Following, 10¬†minutes, web content, KVS, contents of these RDDs

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture