1

我尝试将JSON文件中的简单记录加载到配置单元表中,如下所示。每条JSON记录都在单独的行中。

{"Industry":"Manufacturing","Phone":null,"Id":null,"type":"Account","Name":"Manufacturing"}
{"Industry":null,"Phone":"(738) 244-5566","Id":null,"type":"Account","Name":"Sales"}
{"Industry":"Government","Phone":null,"Id":null,"type":"Account","Name":"Kansas City Brewery & Co"}

但是我找不到任何可以将逗号分隔的记录serde数组加载到配置单元表中。输入是一个包含记录的文件,如下所示...(,)JSONJSON

[{"Industry":"Manufacturing","Phone":null,"Id":null,"type":"Account","Name":"Manufacturing"},{"Industry":null,"Phone":"(738) 244-5566","Id":null,"type":"Account","Name":"Sales"},{"Industry":"Government","Phone":null,"Id":null,"type":"Account","Name":"Kansas City Brewery & Co"}]

有人可以建议我一个serde可以解析这个JSON文件的吗?

谢谢

4

1 回答 1

-1

你可以检查这个 serde:https ://github.com/rcongiu/Hive-JSON-Serde

另一个相关帖子:使用 HIVE 解析 json 数组

于 2017-04-02T12:34:53.980 回答