spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bonsen <hengbohe...@126.com>
Subject When I merge some datas,can't go on...
Date Fri, 26 Feb 2016 07:20:06 GMT
I have a file,like 1.txt:
1 2
1 3 
1 4 
1 5 
1 6 
1 7
2 4
2 5
2 7
2 9

I want to merge them,results like this
map(1->List(2,3,4,5,6,7),2->List(4,5,7,9))
what should I do?。。
val file1=sc.textFile("1.txt")
val q1=file1.flatMap(_.split(' '))???,maybe I should change RDD[int] to
RDD[int,int]?



--
View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/When-I-merge-some-datas-can-t-go-on-tp26341.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
For additional commands, e-mail: user-help@spark.apache.org


Mime
View raw message