'How to read the file stored in cloudera home folder

I am new to python and spark and i have installed cloudera quickstart and I am trying to read a file which i created in cloudera's home folder which is present in the cloudera distribution desktop, how can i read the file?

I tried using the below command to read the file

lines = sc.textFile("file:///home/cloudera/data/testfile.csv") 

Is there any specific format in which the command needs to be written or should I store the file in some other place.

Am I missing something here.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source