再次运行查询时,AWS Athena查询以错误的格式返回结果 [英] AWS Athena query returns results in incorrect format when query is run again

查看:82
本文介绍了再次运行查询时,AWS Athena查询以错误的格式返回结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我第一次运行查询时,它返回了两行带有列名的记录.我编辑了表并添加了skip.header.line.count-1并重新运行(第一次),但它以双引号逗号返回了相同的结果.然后再次运行(第二次),这改变了一切.

The first time I ran the query, it returned 2 rows with columns names. I edited the table and added skip.header.line.count - 1 and reran(First time), but it returned same result with double inverted commas. Then reran again(Second time), and this changed everything.

首次查询运行输出: https://i.stack.imgur.com/k6T2O .png

第二次查询运行输出: https://i.stack.imgur.com/6Cxrf .png

Second time Query run output: https://i.stack.imgur.com/6Cxrf.png

推荐答案

问题是Amazon Athena的输出文件与您的源文件混合在一起.

The problem is that output files from Amazon Athena are being mixed-in with your source files.

要修复此问题,请转到Athena控制台,然后单击设置.

To fix it, go to the Athena console and click Settings.

然后,将查询结果位置更改为指向存储源数据文件的位置的其他位置.

Then, change the Query result location to a different location that does not point to the location where you are storing the source data files.

查询结果"位置是Athena存储查询输出的位置,以防万一您再次需要结果或希望将其用作将来查询的输入.

The Query result location is where Athena stores the output of queries, in case you need the results again or want to use them as input to future queries.

这篇关于再次运行查询时,AWS Athena查询以错误的格式返回结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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