Hi All, 

I changed my way of approach now I am bale to load data into MAP and get
data out using get command.

val QuoteRDD=quotefile.map(x => x.split("\\|")).
      filter(line => line(0).contains("1017")).
      map(x => ((x(5)+x(4)) , (x(5),x(4),x(1) ,
        if (x(15) =="B") 
          if (x(25) =="") x(9)  else (x(25)),
        if (x(37) =="") x(11) else (x(37)),
        if (x(15) =="C") 
          if (x(24) =="") x(9)  else (x(24)),
        if (x(30) =="") x(11) else (x(30)),
        if (x(15) =="A") 
          x(9),
        x(11)
      )))

    val QuoteHashMap=QuoteRDD.collect().toMap
    QuoteHashMap.get("CPHI080000173").foreach(println)

Problem now is how to save value data from the hashmap to a file ? I need to
iterate the keys in hash and save it to a file....

for ( ((k,v)) <-QuoteHashMap) QuoteHashMap.get(k)

Thanks
Sri 







--
View this message in context: 
http://apache-spark-user-list.1001560.n3.nabble.com/Create-hashmap-using-two-RDD-s-tp24996p25008.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@spark.apache.org
For additional commands, e-mail: user-h...@spark.apache.org

Reply via email to