title: Why can't we create an RDD using Spark session
body: <p>We see that, </p>
  
  <pre><code>Spark context available as 'sc'.
  Spark session available as 'spark'.
  </code></pre>
  
  <p>I read spark session includes spark context, streaming context, hive context ...  If so, then why are we not able to create an rdd by using a spark session instead of a spark context.</p>
  
  <pre><code>scala&gt; val a = sc.textFile("Sample.txt")
  17/02/17 16:16:14 WARN util.SizeEstimator: Failed to check whether UseCompressedOops is set; assuming yes
  a: org.apache.spark.rdd.RDD[String] = Sample.txt MapPartitionsRDD[1] at textFile at &lt;console&gt;:24
  
  scala&gt; val a = spark.textFile("Sample.txt")
  &lt;console&gt;:23: error: value textFile is not a member of org.apache.spark.sql.SparkSession
         val a = spark.textFile("Sample.txt")
  </code></pre>
  
  <p>As shown above, <code>sc.textFile</code> succeeds in creating an RDD but not <code>spark.textFile</code>.</p>