'Athena AWS is created empty table

In my following S3 bucket I've gz file without a header that contains one column

In Athena editor, I run the following statement

CREATE EXTERNAL TABLE IF NOT EXISTS `access_file_o`.`Access_one` (
  `ad_id` string,
 
) 
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' 
WITH SERDEPROPERTIES (
  'serialization.format' = ',',
  'field.delim' = ','
) LOCATION 's3://ttt.pix/2022/01/01/00/rrrf.log.1-2022_01_01_00_00_06_316845229-i-06877974d15a00d7e.gz/'
TBLPROPERTIES ('has_encrypted_data'='false','compressionType'='gzip');

The file looks like that

111,
222,
222,
3333,

The table has been created but when I query this table

select * from "Access_one" 

there are no rows, only columns name.

Please advice



Solution 1:[1]

The location should be folder and not file

This URI working well

s3://ttt.pix/2022/01/01/00/

While this one returns an empty table.

LOCATION 's3://ttt.pix/2022/01/01/00/rrrf.log.1-2022_01_01_00_00_06_316845229-i-06877974d15a00d7e.gz

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 idan