0
我想從JSON數據,我是從維基API如何解析使用Scala火花
我能夠打印的恰好
架構中的數據維基信息框JSONscala> data.printSchema
root
|-- batchcomplete: string (nullable = true)
|-- query: struct (nullable = true)
| |-- pages: struct (nullable = true)
| | |-- 28597189: struct (nullable = true)
| | | |-- ns: long (nullable = true)
| | | |-- pageid: long (nullable = true)
| | | |-- revisions: array (nullable = true)
| | | | |-- element: struct (containsNull = true)
| | | | | |-- *: string (nullable = true)
| | | | | |-- contentformat: string (nullable = true)
| | | | | |-- contentmodel: string (nullable = true)
| | | |-- title: string (nullable = true)
我想提取的關鍵數據「*」 |-- *: string (nullable = true)
請給我建議的解決方案。
的一個問題是
pages: struct (nullable = true)
| | |-- 28597189: struct (nullable = true)
數28597189是唯一的每個標題。