[Spark Core Puzzle] In how many ways we can create Spark RDDs?

I personally think it is very easy to create Spark RDDs. But have you ever wonder in how many ways(generic) one can actually create RDDs?

Door’s always open for your answers :slight_smile:

dataRDD = sc.textFile("/user/gnanaprakasam/sqoop_import/departments")

  1. sc.textFile,for creating RDD’s out of existing data files
  2. sc.parallelize, for creating RDD’s from existing data in form of Array or List
  3. Transformations from other RDD’s or DataFrames

@venkatreddy-amalla, In addition to that sc.makeRdd() helps to create a RDD

1 Like