The local file system can be transferred from Spark with the prefix file: ///
Eg: sparkContext.textFile("file:///<<absolute path to file>>")
This command reads a file from the local file system.
Note. If running in a multi node cluster, then this file should be available on all nodes.
source
share