如何配置AWS Athena结果的文件格式 [英] How do I Configure file format of AWS Athena results

查看:237
本文介绍了如何配置AWS Athena结果的文件格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,S3中的Athena查询结果为tsv格式。有什么方法可以配置Athena查询以Parquet格式返回结果。

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.

推荐答案

答案

目前,不可能直接与Athena一起使用。要配置Athena查询的结果,您只能设置查询结果的位置和加密配置。

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.

解决方法

1)从十月起,雅典娜支持CTAS查询,您可以尝试使用此功能。

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

我认为示例4或5可能会让您感兴趣

I think example 4 or 5 may interest you.

2)您可以创建Python脚本并使用Boto3框架。这是示例,您可以使该脚本适应您的要求,并将保存的查询结果添加到镶木地板格式中。

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)要转换数据,您应该使用AWS EMR或AWS Glue等服务。

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

这篇关于如何配置AWS Athena结果的文件格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆