100%(4)4 out of 4 people found this document helpful
This preview shows page 1 out of 1 page.
Name: ___________________________USC ID: ______________________INF 551, Spring 2017Quiz 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?
You've reached the end of your free preview.
Want to read the whole page?
Following,10 minutes,web content,KVS,contents of these RDDs