Hdfs上的数据文件为T0,T1,T2(无后缀): T0: What has come into being in him was life, and the life was the light of all people. The light shines in the darkness, and the darkness did not overcome it. Enter through the narrow gate; for the gate is wide and the road
如果只想append操作: . echo "<Text to append>" | hdfs dfs -appendToFile - yourHdfsPath/test.txt 如果想modify操作: hdfs dfs -get yourHdfsPath/test.txt vi test.txt #or use any other tool and modify it hdfs dfs -put -f test.txt yourHdfsPath/test.txt
对HDFS 上的文件,采用绝对路径,来读取获得 RDD: In [102]: mydata=sc.textFile("file:/home/training/test.txt")17/09/24 06:31:04 INFO storage.MemoryStore: Block broadcast_30 stored as values in memory (estimated size 230.5 KB, free 2.4 MB)17/09/24 06:31:04 INFO stora