How do I Configure file format of AWS Athena results

时光怂恿深爱的人放手 提交于 2019-12-10 13:46:06

问题


Currently, the Athena query results are in tsv format in S3. Is there any way to configure Athena queries to return results in Parquet format.


回答1:


Answer

At this moment it isn't possible to do it directly with Athena. When it comes to configure result of the Athena query you can only setup query result location and encryption configuration.

Workaround

1) From October Athena supports CTAS query, you can try to use this feature.

https://docs.aws.amazon.com/athena/latest/ug/ctas.html

https://docs.aws.amazon.com/athena/latest/ug/ctas-examples.html

I think example 4 or 5 may interest you.

2) You can create Python script and use Boto3 framework. Here is the example, you can adapt this script to your requirements and add saving query results to the parquet format.

https://gist.github.com/schledererj/b2e2a800998d61af2bbdd1cd50e08b76

3) If you want to transform your data you should use rather such services as AWS EMR or AWS Glue.



来源:https://stackoverflow.com/questions/52762871/how-do-i-configure-file-format-of-aws-athena-results

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!