There are two popular ways using which you can create RDD in Apache Spark.
First is Parallelize and other is text File method. Here is quick explanation how both methods can be used for RDD creation.
val a= Array(5,7,8,9)
val b= sc.parallelize(a)
val c = sc.textFile(“demo.txt”);
Hope you got the answer.