title: Spark : Update HashMap in Spark Application
body: <p>I am processing logs in a spark application . I create a Hashmap out of logs and then process it. As part of processing , i have to update value of one the key . But instead of update it is adding a new key-value in the HashMap. and i am getting error <code>Reference 'column1' is ambiguous, could be: column1#31, column1#56</code></p>
  
  <p>My code looks as follows</p>
  
  <pre><code>logs.foreachRDD(rdd =&gt; {  
   val newRDD = rdd.map(p =&gt; createMap(p))
        .map(p =&gt; updateColumns(p))
  
        val sqlContext = SQLContext.getOrCreate(rdd.sparkContext)
        import sqlContext.implicits._
        val df = sqlContext.createDataFrame(newRDD, reqschema)
  
        df.registerTempTable("myTable")
  
        val df1 = sqlContext.sql("Select column1, column2 from myTable")
  }
  
  def createMap(log: String): java.util.HashMap[String, String]={
   ...
  }
  def updateColumns(map : java.util.HashMap[String, String])={
     map.put("column1", "random") // this statements create a new key column1 instead of updating value exiting key "column1" 
  
  }
  </code></pre>
  
  <p>Anyone knows how can we update HashMap in this case ?</p>
  
  <p>Thanks</p>