Hi All, 

just wonderign is there any better way of writing this below code, I am new
to spark an I feel what I wrote is pretty simple and basic and straight
forward is there any better way of writing using functional paradigm.

   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)}
          )
      else if (x(15) =="C" )
        (
          {if (x(24) == "") (x(9))  else x(24)},
          {if (x(30) == "") (x(11)) else x(30)}
          )
      else if (x(15) =="A")
      {(x(9),x(11))}
      )))

Thanks
Sri 



--
View this message in context: 
http://apache-spark-user-list.1001560.n3.nabble.com/Is-there-any-better-way-of-writing-this-code-tp25027.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