Athena JSON 存储和查询

发布于 2025-01-17 17:29:18 字数 288 浏览 1 评论 0原文

我计划以 JSON 格式编写 S3 对象。随着时间的推移,可能会有更多的键被添加到 JSON 对象(稍后写入的对象)中。

然后,我计划通过在这些 S3 对象上运行 athena 查询来生成 csv.gz 文件。

我不想做的是修改 athena 表以在新键添加到 json 时继续添加列名称。我该如何处理这个问题? Athena 是否可以将整个 json 存储在一个字符串列中,然后在我查询时以某种方式将该列的 json 转换为 csv?请记住,我可能不知道前面的所有列名称都是挑战,因为未来对象的 json 键可以比旧对象拥有更多的键

I plan to write S3 objects in JSON format. It is possible that over time, more keys will get added to the JSON objects(the objects that are written later in time).

I then plan to generate csv.gz files by running athena query on these S3 objects.

What I do not want to do is modify the athena table to keep adding column names as new keys get added into json. How do I deal with this? Is it possible that Athena can store the entire json in one string column and then conver that column's json into csv somehow when I query? Remember, I may not know all the column names upfront is the challenge as the json keys for future objects can have more keys then older objects

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文