amazon-s3 - 使用 AWS athena 从 avro 文件读取数组没有结果和未知错误
问题描述
我有几个 avro 文件存储在 S3 存储桶中,并让 AWS Glue 使用 AvroSerde 抓取它们,完美地粘合索引文件。
当我使用 AWS athena 像这样查询表时:select * from mytable
我得到了预期的所有结果,并且“值”列显示为 [23.4,345.6] 例如。
但是,当我尝试选择“值”列(或尝试在其上使用任何数组函数)时,我没有得到任何结果,并且 Athena 中的查询选项卡显示“失败”图标,但是我没有收到任何错误。
失败的示例查询:select values from mytable
雅典娜的输出describe mytable;
timestamp bigint from deserializer
values array<float> from deserializer
account string
year string
month string
day string
hour string
device string
type string
# Partition Information
# col_name data_type comment
account string
year string
month string
day string
hour string
device string
type string
AWS Glue 中的表定义:
Name mytable
Database new_formats_test
Classification avro
Location s3://mytable/
Input format org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat
Output format org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat
Serde serialization lib org.apache.hadoop.hive.serde2.avro.AvroSerDe
Serde parameters
avro.schema.literal {"type":"record","name":"ArchiveDataEntry","namespace":"com.epihunter.data.archive","fields":[{"name":"timestamp","type":"long"},{"name":"values","type":{"type":"array","items":"float"}}]}serialization.format 1
Table properties
sizeKey 18525162objectCount 1UPDATED_BY_CRAWLER Scan S3 new formats
avro.schema.literal {"type":"record","name":"ArchiveDataEntry","namespace":"com.epihunter.data.archive","fields":[{"name":"timestamp","type":"long"},{"name":"values","type":{"type":"array","items":"float"}}]}
解决方案
回答我自己的问题:values
是导致失败的保留关键字。使用双引号"values"
或明显重命名列可以解决问题
推荐阅读
- excel - Excel VBA 循环激活复选框
- xml - 使用 mule dataweave 从 xml 中删除空标签
- 2d - Cesium flyto 在 2d 模式下发疯
- html - 如何样式化
- node.js - 如何为 nodejs 脚本引用全局模块?我可以在我的 nodejs 脚本中引用全局安装的模块吗?
- windows - windows powershell 命令显示特定服务何时以时间戳重新启动
- java - 正则表达式 - 匹配字符,但以特定字符开头的行除外
- jquery - 在点击事件jQuery中使用@Url.Action和参数
- wordpress - WP更新后网站无法正常工作-现在不知道该怎么办
- reactjs - componentWillReceiveProps 方法不安全