title: Save Spark RDD to Hive Table
body: <p>In spark I want to save RDD objects to hive table. I am trying to use createDataFrame but that is throwing </p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.NullPointerException    </p>
  </blockquote>
  
  <pre><code> val products=sc.parallelize(evaluatedProducts.toList);
   //here products are RDD[Product]
   val productdf = hiveContext.createDataFrame(products, classOf[Product])
  </code></pre>
  
  <p>I am using Spark 1.5 version.  </p>