amazon-web-services - 如何通过 Glue 在 AWS Athena 中查询嵌套的 XML 文件
问题描述
我希望嵌套的 XML 文件使用 AWS 胶水从 AWS Athena 进行查询。
<Files>
<File>
<Charges>
<charge>
<FRNo>99988881111</FRNo>
<amount>25.0</amount>
<Date>2019-02-25</Date>
<chargeType>Recur</chargeType>
<phoneNo>4444000012</phoneNo>
</charge>
<charge>
<FRNo>99988881111</FRNo>
<amount>40.0</amount>
<Date>2019-02-25</Date>
<chargeType>Recur</chargeType>
<phoneNo>4444000012</phoneNo>
</charge>
</Charges>
<FRNo>99988881111</FRNo>
<address>New YORK</address>
<amount>111</amount>
<DN>100000</DN>
<name>Rite</name>
<phoneNo>4444000012</phoneNo>
<tax>8.0</tax>
</File>
</Files>
像这样,我有一些 10k 记录。我认为我们必须对 ETL 工作进行一些修改。让我知道任何其他信息。
解决方案
Currently, Amazon Athena does not support the XML file format. You may find the list of supported formats here: Supported SerDes and Data Formats - Amazon Athena
Since AWS Glue supports XML as an ETL input format (https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-format.html), you may first convert your data from XML to JSON and then query the JSON data using Athena.
推荐阅读
- tensorflow - 如何在 keras 中添加自定义图层
- ios - 按钮被某些东西重叠并且无法正常工作
- plsql - 使用过去一年的当前日期值更新列
- javascript - expressjs 在将一些值推送到 lowdb 时重新启动
- javascript - 将图像添加到 PDF 时出现“不完整或损坏的 PNG 文件”
- python - 告诉 Python 乌龟以随机速度沿特定路径前进
- r - 使用 R lubridate 包时在哪里可以找到语言环境值
- html - CSS 让每个网格元素都有不同的高度
- azure - 带有 500/502 响应的 Azure Web 应用超时错误
- kubernetes - PVC 和 pod 中的访问模式