我正在配置单元中为twitterjson文件创建表。我面临的问题是,我无法用struct创建数组,因为在下面的数据中,单个数组中有4个相同的struct。谁能告诉我如何为下面的数据创建数组。我尝试给每个结构赋予不同的名称,表创建成功,但无法从表中提取数据。请帮助。谢谢
> "variants": [
{
"bitrate": 2176000,
"content_type": "video\/mp4",
"url": "https:\/\/video.twimg.com\/ext_tw_video\/560070131976392705\/pu\/vid\/1280x720\/c4E56sl91ZB7cpYi.mp4"
},
{
"bitrate": 320000,
"content_type": "video\/mp4",
"url": "https:\/\/video.twimg.com\/ext_tw_video\/560070131976392705\/pu\/vid\/320x180\/nXXsvs7vOhcMivwl.mp4"
},
{
"bitrate": 832000,
"content_type": "video\/webm",
"url": "https:\/\/video.twimg.com\/ext_tw_video\/560070131976392705\/pu\/vid\/640x360\/vmLr5JlVs2kBLrXS.webm"
},
{
"bitrate": 832000,
"content_type": "video\/mp4",
"url": "https:\/\/video.twimg.com\/ext_tw_video\/560070131976392705\/pu\/vid\/640x360\/vmLr5JlVs2kBLrXS.mp4"
},
{
"content_type": "application\/x-mpegURL",
"url": "https:\/\/video.twimg.com\/ext_tw_video\/560070131976392705\/pu\/pl\/r1kgzh5PmLgium3-.m3u8"
}
]
1条答案
按热度按时间zi8p0yeb1#
试试这个,
把塞德从https://github.com/rcongiu/hive-json-serde