Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'SparkContext' object has no attribute 'textfile'

I tried loading a file by using following code:

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

Error message:

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

like image 275
Mohit Sudhera Avatar asked Mar 19 '16 15:03

Mohit Sudhera


1 Answers

It is sc.textFile(...) with a capital F.

You can inspect the API of SparkContext here.

like image 189
Daniel Zolnai Avatar answered Sep 19 '22 22:09

Daniel Zolnai