I'm having a tuple of 3 elements and trying to zip with an Array of size=3 using the below approach
val tup3= (10:BigInt,9:BigInt,3:BigInt)
val arr3:Array[String] = Array("cnt", "mxid2","nullid3")
val map_result = tup3.productIterator.toArray.zip(arr3).map( x => (x._2,x._1)).toMap
when I try the other way around to avoid the swapping of elements, I'm getting error
arr3.zip(tup3.productIterator.toArray)
<console>:30: error: polymorphic expression cannot be instantiated to expected type;
found : [B >: Any]Array[B]
required: scala.collection.GenIterable[?]
arr3.zip(tup3.productIterator.toArray)
^
how to fix this error?.