在Spark大數據分析平台上執行下列的Python程式碼: file=spark.textFile("hdfs://…") //opens a file counts=file.flatMap(lambda line: line.split(" ")) //iterate over the lines, split each line by space into words .map(lambda word: (word, 1)) //for each word, create the tuple (word, 1) .reduceByKey(lambda a, b: a+b) //go over the tuples "by key" (first element) and sum the second elements counts.saveAsTextFile("hdfs://…") 當輸入短文: a spark can start a fire that burns the entire prairie 請問最後存入到 HDFS 檔案的(key, value)一共有多少對?
A8
B9
C10正確答案
D11
答案與詳解
