Amazon s3 使用AWS athena从avro文件中读取数组不会给出任何结果和未知错误
我有几个avro文件存储在S3存储桶中,并使用AvroSerde通过AWS Glue对它们进行爬网,完美地粘合索引文件 当我使用AWS athena这样查询表时:Amazon s3 使用AWS athena从avro文件中读取数组不会给出任何结果和未知错误,amazon-s3,avro,amazon-athena,aws-glue,Amazon S3,Avro,Amazon Athena,Aws Glue,我有几个avro文件存储在S3存储桶中,并使用AvroSerde通过AWS Glue对它们进行爬网,完美地粘合索引文件 当我使用AWS athena这样查询表时:select*from mytable我得到了预期的所有结果,“values”列显示为[23.4345.6] 然而,当我尝试选择“values”列(或尝试在其上使用任何数组函数)时,我没有得到任何结果,雅典娜中的查询选项卡显示一个“FAiled”图标,但是我没有得到任何错误 失败的查询示例:从mytable中选择值 的雅典娜输出描述my
select*from mytable
我得到了预期的所有结果,“values”列显示为[23.4345.6]
然而,当我尝试选择“values”列(或尝试在其上使用任何数组函数)时,我没有得到任何结果,雅典娜中的查询选项卡显示一个“FAiled”图标,但是我没有得到任何错误
失败的查询示例:从mytable中选择值
的雅典娜输出描述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
回答我自己的问题:values
是导致失败的保留关键字。使用双引号(如“values”
)或重命名列显然可以解决此问题
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"}}]}