Amazon web services 使用Kinesis分析解析复杂JSON

Amazon web services 使用Kinesis分析解析复杂JSON,amazon-web-services,amazon-kinesis,amazon-athena,Amazon Web Services,Amazon Kinesis,Amazon Athena,我有以下来自Twitter的JSON流 { "created_at": "Thu Sep 27 21:02:00 +0000 2018", "id": 1045418301336244224, "id_str": "1045418301336244224", "text": "Conditional Branching Now Supported in AWS Systems Manager Automation - @awscloud #amazon #aws", "sou

我有以下来自Twitter的JSON流

{
  "created_at": "Thu Sep 27 21:02:00 +0000 2018",
  "id": 1045418301336244224,
  "id_str": "1045418301336244224",
  "text": "Conditional Branching Now Supported in AWS Systems Manager Automation - @awscloud #amazon #aws",
  "source": "<a href=\"https://buffer.com\" rel=\"nofollow\">Buffer</a>",
  "truncated": false,
  "in_reply_to_status_id": null,
  "in_reply_to_status_id_str": null,
  "in_reply_to_user_id": null,
  "in_reply_to_user_id_str": null,
  "in_reply_to_screen_name": null,
  "user": {
    "id": 14687423,
    "id_str": "14687423",
    "name": "Casey Becking",
    "screen_name": "caseybecking",
    "location": "Huntington Beach, CA",
    "url": "http://caseybecking.com",
    "description": "I do stuff with computers for @rackspace , geek at heart! play and watch to much hockey, someday I'll make a personal website.",
    "translator_type": "none",
    "protected": false,
    "verified": false,
    "followers_count": 4191,
    "friends_count": 2412,
    "listed_count": 90,
    "favourites_count": 794,
    "statuses_count": 12995,
    "created_at": "Wed May 07 15:03:23 +0000 2008",
    "utc_offset": null,
    "time_zone": null,
    "geo_enabled": true,
    "lang": "en",
    "contributors_enabled": false,
    "is_translator": false,
    "profile_background_color": "000000",
    "profile_background_image_url": "http://abs.twimg.com/images/themes/theme15/bg.png",
    "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme15/bg.png",
    "profile_background_tile": false,
    "profile_link_color": "ABB8C2",
    "profile_sidebar_border_color": "000000",
    "profile_sidebar_fill_color": "000000",
    "profile_text_color": "000000",
    "profile_use_background_image": false,
    "profile_image_url": "http://pbs.twimg.com/profile_images/981617292546060289/RMX0GQFe_normal.jpg",
    "profile_image_url_https": "https://pbs.twimg.com/profile_images/981617292546060289/RMX0GQFe_normal.jpg",
    "profile_banner_url": "https://pbs.twimg.com/profile_banners/14687423/1439137746",
    "default_profile": false,
    "default_profile_image": false,
    "following": null,
    "follow_request_sent": null,
    "notifications": null
  },
  "geo": null,
  "coordinates": null,
  "place": null,
  "contributors": null,
  "is_quote_status": false,
  "quote_count": 0,
  "reply_count": 0,
  "retweet_count": 0,
  "favorite_count": 0,
  "entities": {
    "hashtags": [{
      "text": "amazon",
      "indices": [106, 113]
    }, {
      "text": "aws",
      "indices": [114, 118]
    }],
    "urls": [{
      "url": "",
      "expanded_url": "https://buff.ly/2zwRyBx",
      "display_url": "buff.ly/2zwRyBx",
      "indices": [72, 95]
    }],
    "user_mentions": [{
      "screen_name": "awscloud",
      "name": "Amazon Web Services",
      "id": 66780587,
      "id_str": "66780587",
      "indices": [96, 105]
    }],
    "symbols": []
  },
  "favorited": false,
  "retweeted": false,
  "possibly_sensitive": false,
  "filter_level": "low",
  "lang": "en",
  "timestamp_ms": "1538082120628",
  "emoticons": [],
  "sentiments": "Neutral"
}
{
“创建时间”:“2018年9月27日星期四21:02:00+0000”,
“id”:1045418301336244224,
“id_街”:“1045418301336244224”,
“文本”:“AWS Systems Manager Automation-@awscloud#amazon#AWS现在支持条件分支”,
“来源”:“,
“截断”:false,
“在对状态id的回复中”:null,
“在对状态的回复中”id“str”:空,
“in_reply_to_user_id”:null,
“在对用户id的回复中”:null,
“回复至屏幕名称”为空,
“用户”:{
“id”:14687423,
“id_街”:“14687423”,
“姓名”:“Casey Becking”,
“屏幕名称”:“caseybecking”,
“地点”:“加利福尼亚州亨廷顿海滩”,
“url”:”http://caseybecking.com",
“描述”:“我为@rackspace做电脑工作,我的内心是个极客!玩曲棍球和看曲棍球,总有一天我会建立一个个人网站。”,
“翻译器类型”:“无”,
“受保护”:错误,
“已验证”:错误,
“粉丝数”:4191,
“朋友数”:2412,
“列出的数量”:90,
“最受欢迎人数”:794,
“状态计数”:12995,
“创建时间”:“Wed May 07 15:03:23+0000 2008”,
“utc_偏移量”:空,
“时区”:空,
“geo_enabled”:正确,
“郎”:“恩”,
“已启用贡献者”:false,
“is_translator”:错误,
“配置文件背景颜色”:“000000”,
“配置文件\背景\图像\ url”:http://abs.twimg.com/images/themes/theme15/bg.png",
“配置文件\u背景\u图像\u url\u https”:https://abs.twimg.com/images/themes/theme15/bg.png",
“配置文件\u背景\u平铺”:false,
“配置文件链接颜色”:“ABB8C2”,
“配置文件\侧边栏\边框\颜色”:“000000”,
“配置文件\侧边栏\填充\颜色”:“000000”,
“配置文件\文本\颜色”:“000000”,
“profile\u use\u background\u image”:false,
“配置文件\图像\ url”:http://pbs.twimg.com/profile_images/981617292546060289/RMX0GQFe_normal.jpg",
“配置文件\u图像\u url\u https”:https://pbs.twimg.com/profile_images/981617292546060289/RMX0GQFe_normal.jpg",
“配置文件\u横幅\u url”:https://pbs.twimg.com/profile_banners/14687423/1439137746",
“默认配置文件”:false,
“默认_配置文件_图像”:false,
“following”:空,
“跟踪请求发送”:空,
“通知”:空
},
“geo”:空,
“坐标”:空,
“地点”:空,
“贡献者”:空,
“is_quote_status”:false,
“quote_count”:0,
“回复计数”:0,
“转发计数”:0,
“收藏夹计数”:0,
“实体”:{
“hashtags”:[{
“文本”:“亚马逊”,
“指数”:[106113]
}, {
“文本”:“aws”,
“指数”:[114118]
}],
“URL”:[{
“url”:“,
“扩展url”:https://buff.ly/2zwRyBx",
“显示url”:“buff.ly/2zwRyBx”,
“指数”:[72,95]
}],
“用户_提到”:[{
“屏幕名称”:“awscloud”,
“名称”:“亚马逊网络服务”,
“id”:66780587,
“id_街”:“66780587”,
“指数”:[96105]
}],
“符号”:[]
},
“偏爱”:错误,
“转发”:错误,
“可能敏感”:错,
“过滤器级别”:“低”,
“郎”:“恩”,
“时间戳”:“1538082120628”,
“表情符号”:[],
“情感”:“中立”
}
如何使用Kinesis分析解析、分析和处理此JSON


阵列应该展平,这在Hive中非常可行,但在Kinesis分析中也需要这样做。

我在这里发布了一个类似的问题,这是很久以前发布的,我将其发送给Kinesis产品团队,甚至他们都没有答案。复杂的JSON展平在Athena中更为优越,请参阅此处