将json数据加载到配置单元表中

nsc4cvqm  于 2021-06-26  发布在  Hive
关注(0)|答案(1)|浏览(322)

我试过装简单的 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 记录到配置单元表中。输入是一个包含 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 文件?
谢谢

9avjhtql

9avjhtql1#

您可以检查这个序列:https://github.com/rcongiu/hive-json-serde
另一篇相关文章:使用hive解析json数组

相关问题