How to query .json.gz files from Amazon Athena?

0

I am trying to query the .json.gz files from amazon Athena, somehow i am not able to query as the way that I am doing for normal files.

I am using Glue Crawler to crawl the data into glue catalog and then querying it using Amazon Athena.
I do have only one file per folder and glue is able to crawl those properly, the issue is in querying the files using athena.

I am getting the below error.

​​​​

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)

This query ran against the "new1" database, unless qualified by the query. Please post the error message on our forum or contact customer support with Query Id: e25ec322-c5d

Any help appreciated.
Thanks in advance.

Edited by: dxaws on Jun 4, 2019 5:36 AM

dxaws
질문됨 5년 전1756회 조회
1개 답변
0
수락된 답변

This is because you gzipped a file pretty json instead of flattened json. You should flattend json instead of pretty json to work with Athena Queries.

raghuRR
답변함 5년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인