可以从AWS Athena下载CSV数据以可用格式

发布于 2025-02-09 17:29:28 字数 460 浏览 3 评论 0原文

我在S3存储桶中有70,000多个CSV文件。他们都有相同的标题。我想将文件组合到一个CSV中,我想将其下载到我的计算机上。

使用AWS雅典娜,我似乎是大部分时间。我已经从S3存储桶中创建了一个数据库。然后,我可以像这样运行查询:

select * from my_table_name limit 100

查看查询的结果(在我的情况下是将来自S3的许多CSV组合在一起)。

但是,当我转到该查询的“下载结果”时,我无法在Excel(或文本编辑器)中打开CSV。

file -b my_table_name.csv

返回数据

我很困惑,因为我可以从视觉上查看雅典娜查询的结果,但不能以可用的文件格式下载它们。我是否错过了如何下载此数据的明显内容?为什么不给我正常(也许是UTF-8)CSV?

I've got 70,000+ CSV files in an S3 bucket. They all have the same headers. I would like to combine the files into one CSV, which I want to download onto my machine.

Using AWS Athena, I seem to be most of the way there. I have created a database from the S3 bucket. I can then run queries like this:

select * from my_table_name limit 100

And see the results of the query (which in my case is combining many CSVs from S3) in the Athena console.

However when I go to "Download results" of that query, I can't open the CSV in Excel (or a text editor).

Doing

file -b my_table_name.csv

returns data.

I'm confused because I can visually see the results of my Athena query but can't download them in a usable file format. Am I missing something obvious for how to download this data? Why isn't it giving me a normal (perhaps UTF-8) CSV?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

岁月蹉跎了容颜 2025-02-16 17:29:28

在雅典娜的设置中,我进行了加密。解决了。

In Athena settings, I had encryption on. That solved it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文