Reputation: 448
I am new to the spark programming. I have come across a scenario, to map each element of an RDD to another format. So I tried to get the 2nd element of the tuple(x._2). But it is giving an error Value _2 is not a member of Array[String]
Do I miss something here... Pls helppp....
Upvotes: 0
Views: 198
Reputation: 4296
The problem is its not tuple as you expect. Its an Array[Array[String]]
. You can get the second element of an array with array(1)
month1.map(x => x(1))
Upvotes: 2