Mohit Sudhera
Mohit Sudhera

Reputation: 341

'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'

Upvotes: 5

Views: 12616

Answers (1)

Daniel Zolnai
Daniel Zolnai

Reputation: 16920

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

You can inspect the API of SparkContext here.

Upvotes: 14

Related Questions