Input file doesn't exist for spark application in Intellij Idea



Hi, I’ve configured winutils.exe to support spark in windows machine. While I’m trying to develop sample spark application in Intellij Idea, I was repeatedly getting “input file path doesn’t exist”. Since, i had a file at local, hdfs . File name is “one.txt”
I know that loading a local file syntax is :“filepath”)
for hdfs location means: sc.textFile(“filepath”)

In Intellij idea I’ve used to load file as:
//file loading from hdfs location
val data = sc.textFile(“hdfs://”)
// file loading from local file location
// val data1 = Source.fromFile("/home/saikiranchepuri35/one.txt").getLines().toList
// val data = sc.parallelize(data1)

val rdd1 = data.flatMap(_.split(",")).map(word=>(word,1))


Can anyone please help me out how to give exactly the correct path to work on it. As I’m facing this issue from morning to evening and went the videos couldn’t resolve it.

Exception in thread “main” \home\saikiranchepuri35\one.txt (The system cannot find the path specified)
at Method)

Learn Spark 1.6.x or Spark 2.x on our state of the art big data labs

  • Click here for access to state of the art 13 node Hadoop and Spark Cluster


Please go through this topic