【发布时间】:2018-08-27 09:51:54
【问题描述】:
我有一个如下的RDD:
scala> topWithKeysSorted.take(10).foreach(println)
(1,[Lscala.Tuple4;@3e0c2650)
(2,[Lscala.Tuple4;@fef700c)
(3,[Lscala.Tuple4;@1ecb9068)
(4,[Lscala.Tuple4;@35b53a35)
(5,[Lscala.Tuple4;@6ad4a475)
(6,[Lscala.Tuple4;@1e4fd633)
(7,[Lscala.Tuple4;@5c455d42)
(8,[Lscala.Tuple4;@40bdb06d)
(9,[Lscala.Tuple4;@f854303)
(10,[Lscala.Tuple4;@6f9be28e)
scala> topWithKeysSorted.first
res38: (Int, Array[(Int, Int, String, Float)]) = (1,Array((1,2,Quest Q64 10 FT. x 10 FT. Slant Leg Instant U,59.98)))
如何将其转换为(Int, Int, Int, String, Float)?我在想应该有一些我不知道的简单易行的方法。
非常感谢。
【问题讨论】:
标签: scala list apache-spark tuples