我尝试将文件中的简单JSON
记录加载到hive表中,如下所示。每个{"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
分隔的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
有人可以建议我JSON
来解析这个{{1}}文件吗?
由于
答案 0 :(得分:-1)
您可以查看此服务:https://github.com/rcongiu/Hive-JSON-Serde
另一篇相关帖子:Parse json arrays using HIVE