in Spark Sql by

Syntax to create a DataFrame based on the content of a JSON file 

(i)spark.textfile("examples/src/main/resources/data.json") 

(ii)spark.read("examples/src/main/resources/data.json") 

(iii)spark.read.json("examples/src/main/resources/data.json") 

(iv)spark.json("examples/src/main/resources/data.json") 

1 Answer

0 votes
by

Correct answer option is spark.read.json("examples/src/main/resources/data.json") 

...