Spark 2.0.0无法解析以下JSON

时间:2016-12-07 15:50:49

标签: apache-spark apache-spark-sql

我在spark中解析了以下JSON,这是Influxdb的输出,spark进入某个循环并且结果永远不会被返回

{"results":[{"series":[{"name":"mos-st.builds","columns":    ["time","number","name","node"],"values":[["2016-11-29T11:00:04Z",74,"ScaleWindowsNodes",null],["2016-11-29T11:00:05Z",90720,"team-admin/Empty job","Job-manager-Machine ami-2a2e2842 (i-8262098c)"],["2016-11-29T11:00:07Z",74,"ScaleWindowsNodes",null],["2016-11-29T11:00:10Z",3022,"team-search/seed-8449","Job-manager-Machine ami-2a2e2842 (i-8262098c)"],["2016-11-29T11:05:00Z",3023,"team-search/seed-8449",null],["2016-11-29T11:20:05Z",90724,"team-admin/Empty job","Job-manager-Machine ami-2a2e2842 (i-8262098c)"],["2016-11-29T11:20:09Z",3026,"team-search/seed-8449","Job-manager-Machine ami-2a2e2842 (i-8262098c)"],["2016-11-29T11:25:00Z",90725,"team-admin/Empty job",null],["2016-11-29T11:25:00Z",3027,"team-search/seed-8449",null],["2016-11-29T11:25:05Z",90725,"team-admin/Empty job","Job-manager-Machine ami-2a2e2842 (i-8262098c)"],["2016-11-29T11:25:10Z",3027,"team-search/seed-8449","Job-manager-Machine ami-2a2e2842 (i-8262098c)"],["2016-11-29T11:30:00Z",90726,"team-admin/Empty job",null],["2016-11-29T12:10:00Z",90734,"team-admin/Empty job",null],["2016-11-29T12:10:05Z",90734,"team-admin/Empty job","Job-manager-Machine ami-2a2e2842 (i-8262098c)"],["2016-11-29T12:10:09Z",3036,"team-search/seed-8449","Job-manager-Machine ami-2a2e2842 (i-8262098c)"]]}]}]}

代码如下:

 val df = sqlContext.read.json("<location>/sample.json")

0 个答案:

没有答案