简体   繁体   English

雅典娜查询返回列名作为结果集

[英]athena query return column name as a result set

Hi I have just created a schema in AWS ATHENA as follow 嗨,我刚刚在AWS ATHENA中创建了一个架构,如下所示

Create table test (BATCHJOBID  bigint,
CONFIGRECID  bigint,
ENDDATETIME string,
ENDDATETIMETZID  int,
INTJNLID string,
INTJNLTBLRECID  bigint,
PROCESSINGSTATUS  int,
STARTDATETIME string,
STARTDATETIMETZID int,
INTJNLIDBLOCKING string,
RECVERSION int,
PARTITION  bigint,
RECID bigint)

But when I am query S3 csv file data 但是当我查询S3 csv文件数据时

Select * from test 

it return all the value including additional row which are the column name where data type are string. 它返回所有值,包括附加行,这些行是数据类型为字符串的列名。

What could be wrong in DDL statement which returning column(string Type) name as result set 返回结果列(字符串类型)名称作为结果集的DDL语句中可能出了什么问题

I'm afraid this is the ResultSet structure Amazon has chosen for its Javascript SDK, and there is no way to change it. 恐怕这是亚马逊为其Javascript SDK选择的ResultSet结构,无法更改它。

The JDBC driver, for example, does not have this behavior. 例如,JDBC驱动程序不具有此行为。

I'm still very new to Athena. 我对Athena还是很陌生。 From the AWS Athena docs : "If you are writing CSV files from AWS Glue to query using Athena, you must remove the CSV headers so that the header information is not included in Athena query results" and goes on show how a Glue ETL job can transform the file to strip the headers. AWS Athena文档中 :“如果要从AWS Glue编写CSV文件以使用Athena进行查询,则必须删除CSV标头,以便标头信息不包括在Athena查询结果中”,然后继续说明如何使用Glue ETL作业转换文件以去除标题。 I realize the question is about Athena NOT Glue but I suppose the header guidance may still apply. 我意识到问题是关于Athena NOT Glue,但我想标题指南可能仍然适用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM