50. 在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)一共有多少對?
(A) 8
(B) 9
(C) 10
(D) 11

答案:登入後查看
統計: 尚無統計資料