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
posta un anno fa1196 visualizzazioni
3 Risposte
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
con risposta un anno fa
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
con risposta un anno fa
0

After creating table you need to add partitions

MSCK REPAIR TABLE <tablename>
;
profile pictureAWS
con risposta un anno fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande