Cannot Read a file from HDFS using Spark
Here is the solution sc.textFile(“hdfs://nn1home:8020/input/war-and-peace.txt”) How did I find out nn1home:8020? Just search for the file core-site.xml and look for xml element fs.defaultFS
Here is the solution sc.textFile(“hdfs://nn1home:8020/input/war-and-peace.txt”) How did I find out nn1home:8020? Just search for the file core-site.xml and look for xml element fs.defaultFS
In command line, you can use spark-shell -i file.scala to run code which is written in file.scala
If you use Spark-Shell, it appears in the banner at the start. Programatically, SparkContext.version can be used.