title: What is the difference between DataFrame.cache() and hiveContext.cacheTable?
body: <p>Is there any difference between the following snippets:</p>
  
  <pre><code>val df = hiveContext.createDataFrame(rows, schema)
  df.registerTempTable("myTable")
  df.cache()
  </code></pre>
  
  <p>and</p>
  
  <pre><code>val df = hiveContext.createDataFrame(rows, schema)
  df.registerTempTable("myTable")
  hiveContext.cacheTable("myTable")
  </code></pre>