【发布时间】:2017-09-15 15:52:50
【问题描述】:
如下:
test: Array[scala.collection.immutable.Map[String,Any]] = Array(
Map(_c3 -> "foobar", _c5 -> "impt", _c0 -> Key1, _c4 -> 20.0, _c1 -> "next", _c2 -> 1.0),
Map(_c3 -> "high", _c5 -> "low", _c0 -> Key2, _c4 -> 19.0, _c1 -> "great", _c2 -> 0.0),
Map(_c3 -> "book", _c5 -> "game", _c0 -> Key3, _c4 -> 42.0, _c1 -> "name", _c2 -> 0.5)
)
如何根据仅包含 Strings 的 _c0 将其转换为 Key Value 对?
如下所示
Key1 foobar
Key1 impt
Key1 next
Key2 high
Key2 low
Key2 great
Key3 book
Key3 game
Key3 name
【问题讨论】:
标签: scala apache-spark