Spark insert to hive -JavaPairDStream
<p>Spark insert in to hive :  </p>

<pre><code>  finalRDDStream.transform(new Function&lt;JavaPairRDD&lt;OutcomeKey,Tuple2&lt;String,String&gt;&gt;, JavaRDD&lt;Joinkey&gt;&gt;() {

                    private static final long serialVersionUID = 1L;

                    @Override
                    public JavaRDD&lt;Joinkey&gt; call(JavaPairRDD&lt;OutcomeKey, Tuple2&lt;String, String&gt;&gt; arg0)  throws Exception {


                        JavaRDD&lt;Joinkey&gt; a = arg0.map(x -&gt; {
                            OutcomeKey key = x._1;
                            Joinkey joinkey= new Joinkey();     
                            joinkey.setDate(key.getDate().toString());
                            joinkey.setPublicIP(key.getPublicIP());
                            joinkey.setPrivateIP(key.getPrivateIP());
                            joinkey.setMsisdn(x._2._1);
                            joinkey.setUrlVisited(x._2._2);
                            return joinkey;
                            });


                        DataFrame fileDF = sqlContext.createDataFrame(a, Joinkey.class);
                        fileDF .insertInto("test.fileDF ");
                        fileDF .show();
                        return null;

                    }
                });  
</code></pre>

<p>I am trying to insert JoinKey class object to hive. This way I get error.   </p>

<pre><code>16/06/03 03:31:42 ERROR streaming.StreamingContext: Error starting the context, marking it as stopped
java.lang.IllegalArgumentException: requirement failed: No output operations registered, so nothing to execute
        at scala.Predef$.require(Predef.scala:233)
        at org.apache.spark.streaming.DStreamGraph.validate(DStreamGraph.scala:161)
</code></pre>

<p>Is there any other way to insert into hive.             </p>