Hadoop – ‘SparkContext’ Object No Properties ‘TextFile’

I tried to load the file using the following code:

textdata = sc.textfile('hdfs://localhost:9000 /file.txt')

Error message:

AttributeError:’SparkContext’ object has no attribute’textfile’

< /blockquote>

It is sc.textFile(…), with a capital letter F.

You can check the API of SparkContext here.

I tried to load the file with the following code:

< pre>textdata = sc.textfile(‘hdfs://localhost:9000/file.txt’)

Error message:

AttributeError :’SparkContext’ object has no attribute’textfile’

It is sc.textFile(…), with a capital letter F.

You can check the API of SparkContext here.

Leave a Comment

Your email address will not be published.