Converting Array[(Int, String)] in to Tuple in spark-scala


#1

How to convert array of int,string into tuple ans then use reduce by key using spark-scala

s: Array[(Int, String)] = Array((1,2013-07-25), (2,2013-07-25), (3,2013-07-25))


#2

Hi rajasekhar1,
Try this.
val s = Array((1,“2013-07-25”), (2,“2013-07-25”), (3,“2013-07-25”))
val rdd=sc.parallelize(s)
rdd.reduceByKey(…)