java.lang.ClassNotFoundException: Failed to find data source: textFile

Below line of code is giving the error - java.lang.ClassNotFoundException: Failed to find data source: textFile

spark.read.format(“textFile”).load(“H_data/flight-data/csv/2010-summary.csv”).show(5)

Though below line of code is working fine -
spark.read.format(“text”).load(“H_data/flight-data/csv/2010-summary.csv”).show(5)

Both the above codes are in Python.

Please note in ‘Spark:The Definitive Guide’ below is written -

"Reading text files is straightforward: you simply specify the type to be # textFile.
With textFile, partitioned directory names are ignored.
To read and write text files according to partitions, you should use # text,
which respects partitioning on reading and writing.

I think I got the PARTIAL answer as when i ran “spark.read.textFile(“H_data/flight-data/csv/2010-summary.csv”).selectExpr(“split(value, ‘,’) as rows”).show(3,False)”

it gave error - “‘DataFrameReader’ object has no attribute ‘textFile’”