简体   繁体   English

支持JSON数组的HSON的JSON SerDe

[英]JSON SerDe for Hive that supports JSON arrays

I have tried the JSON SerDe that Amazon provides for EMR instance and works great if you need to address/map JSON dictionary fields to columns. 我已经尝试过亚马逊为EMR实例提供的JSON SerDe,如果你需要将JSON字典字段地址/映射到列,那么效果很好。 However I wasn't been able to figure how to do the same with JSON arrays. 但是我无法想象如何对JSON数组做同样的事情。 For example if there is a JSON array as follows: 例如,如果有一个JSON数组,如下所示:

[23123.32, "Text Text", { "key1": "value1" } ] [23123.32,“文字文字”,{“key1”:“value1”}]

Is there a way to map the first element of an array to a column in Hive table? 有没有办法将数组的第一个元素映射到Hive表中的列? What about the embedded dictionary fields? 嵌入式字典字段怎么样?

我一直在努力解决同样的问题,直到我在github上找到这个serde - https://github.com/rcongiu/Hive-JSON-Serde一旦你启动hive就使用'add jar'命令包含它,它就像一个魅力。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM