To create an RDD from external file sources, you need to do this below steps following:
scala> var test = sc . textFile("hdfs://localhost:9000/exaample/sample")
The external file here is hdfs. So, you can see the example below:
So, here you can see its created, a new RDD from external file sources that is hdfs.