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
질문됨 일 년 전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
답변함 일 년 전
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
답변함 일 년 전
0

After creating table you need to add partitions

MSCK REPAIR TABLE <tablename>
;
profile pictureAWS
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠