Trying to reduceByKey on multidimensional list using scala , such that tuples are appended to parent tuple and thus generate multidimensional tuple.
In python I am trying to append to multidimensional list as follows and it works perfectly :
.map(lambda z:(z[1][0][1],[[z[1][0][1],str(z[1][0][2]),str(z[1][0][3]),z[1][0][0].strftime('%Y-%m-%dT%H:%M:%SZ'),z[1][1]]])).reduceByKey(lambda a,b:a+b)
But in scala I am unable to use reduceByKey , I am trying following :
.map(t => (t._2._1._2,((t._2._1._2,t._2._1._3,t._2._1._4,t._2._1._1,t._2._2)))).reduceByKey(t,y => t++y)
Any hints in right direction are also welcome!