I am a beginner in Spark and I am trying to create a DataFrame based on the content of JSON file using PySpark by following the guide: http://spark.apache.org/docs/1.6.1/sql-pro
If you are running your code on local mode then provide complete path of your file.
Suppose your file location is "/user/ABC/examples/src/main/resources/people.json". Then your code should be like this.
df =sqlContext.read.json("/user/ABC/examples/src/main/resources/people.json")
If you are running your code yarn mode then check your file exist in HDFS and provide complete location
df = sqlContext.read.json("/user/ABC/examples/src/main/resources/people.json")