Reputation: 83
I get a RDD with 'Scan' action from 'HBase'. Each item in this RDD is like: x1, y1, y2, y3... So the items in this RDD are like(each line is a row result of scan action):
I want transform this RDD to another RDD like:
How can I do this transform?
Upvotes: 0
Views: 77
Reputation: 67115
rdd.flatMap(x => {
val key = x.head
x.tail.map(y=>(key,y))
})
Upvotes: 2