如何从 Amazon Athena 查询 .json.gz 文件?

0

【以下的问题经过翻译处理】 我正在尝试从 amazon Athena 查询 .json.gz 文件,但我无法像查询普通文件那样查询。

我正在使用 Glue Crawler 将数据爬取到Glue目录中,然后使用 Amazon Athena 对其进行查询。

我确认每个文件夹只有一个文件,Glue能够正确抓取这些文件,问题在于如何使用 athena 查询文件。

我收到以下错误。

HIVE_METASTORE_ERROR: com.facebook.presto.spi.PrestoException: Error: : expected at the position 23 of 'struct<OS:struct<device ID:string,deviceType:string,platform:string,version:string,deviceManufacturer:string,deviceSize:string>,app:struct<app_version:string,auth_server:string,gui_version:string,lang:string,name:string,ua:string>,campaign:string,library:structname:string,version:string,page:structpath:string,referrer:string,search:string,title:string,url:string,userAgent:string,ip:string>' but ' ' is found. (Service: null; Status Code: 0; Error Code: null; Request ID: null)

此查询针默认在“new1”数据库运行,除非显示指定。

请在我们的论坛上发布错误信息或使用如下 ID 联系客户支持:e25ec322-c5d

感谢!

编辑者:dxaws,2019 年 6 月 4 日 5:36 AM

profile picture
专家
已提问 5 个月前21 查看次数
1 回答
0

【以下的回答经过翻译处理】 这是因为您压缩了一个pretty json 文件而不是flattened json。您应该使用flattened json 而不是 pretty json 来使用 Athena 查询。

profile picture
专家
已回答 5 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则