我正在練習一些火花代碼,並開始自己我被困在下面的錯誤。RDD不可迭代錯誤
newRDD = sc.textFile("/user/cloudera/sqoop-import/products")
17/03/15 20:41:31 INFO storage.MemoryStore: Block broadcast_1 stored as values in memory (estimated size 198.0 KB, free 419.3 KB) 17/03/15 20:41:31 INFO storage.MemoryStore: Block broadcast_1_piece0 stored as bytes in memory (estimated size 23.3 KB, free 442.7 KB) 17/03/15 20:41:31 INFO storage.BlockManagerInfo: Added broadcast_1_piece0 in memory on 192.168.50.129:49855 (size: 23.3 KB, free: 530.2 MB) 17/03/15 20:41:31 INFO spark.SparkContext: Created broadcast 1 from textFile at NativeMethodAccessorImpl.java:-2
for i in newRDD:
... print(i)
...
回溯(最近通話最後一個): 文件 「」,1號線,在 類型錯誤: 'RDD' 對象不是可迭代
可能的重複[我如何在apache spark(scala)中迭代RDD](http://stackoverflow.com/questions/25914789/how-do-i-iterate-rdds-in-apache-spark-scala) –