Athena Query result giving back empty table

0

Hi! I used Athena Query maker to take some data from a CSV file and create a table and database from it. I've added all the columns that I have in my CSV, including the correct types (timestamp, string), the query is correct, it runs, but I get an empty table as an output. I can't tell where is the problem, any idea helps The query:

CREATE EXTERNAL TABLE IF NOT EXISTS `flightsfromcsv`.`detailsofflight` (
  `Departure` timestamp,
  `From` string,
  `Arrival` timestamp,
  `To` string,
  `Companyinfo` string )
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'
WITH SERDEPROPERTIES ('field.delim' = ',')
STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat' OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION 's3://nameofbucket/'
TBLPROPERTIES ('classification' = 'csv');

The CSV has only the " , " delimiter and it contains the following columns: Departure, From, Arrival, To, Companyinfo

profile picture
已提问 1 年前1196 查看次数
3 回答
0

Athena suggests to use lower case for table names and table column names. Please refer below link

https://docs.aws.amazon.com/athena/latest/ug/tables-databases-columns-names.html

Kiran
已回答 1 年前
0

Hello,

I noticed that in location parameter for Create Table you have provided backet name only (LOCATION 's3://nameofbucket/'). Make sure that this bucket only consist csv data with schema provided in table DDL. I am suspecting this backet consist other folders and files due to which Athena generated emplty results. Please check this location again and if ithis bucket consist other folder and files, then move the csv file to different prefix and in location provide s3 location till prefix which consist csv files with mentioned schema.

AWS
已回答 1 年前
0

After creating table you need to add partitions

MSCK REPAIR TABLE <tablename>
;
profile pictureAWS
已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则