Quering CSV file in Athena

1

Hello, I have a CSV file stored in the S3 bucket that is being updated daily. The CSV file has several tabs. each tab is a different table. I want to use this CSV file as a DB in QuickSight AWS. I use this query-

CREATE EXTERNAL TABLE IF NOT EXISTS Harvesting ( BatchID int, Crop int, HarvestingDate date, FlowersAmount int )

ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' LOCATION 's3://vf-flowers/' TBLPROPERTIES ('skip.header.line.count'='1');

Currently, this pulls all the data from all the tabs. How can I create a different table for each tab in the CSV?

Thanks in advance, Mia

已提问 2 个月前170 查看次数
2 回答
1

Hello there,

If you have multiple tabs, then it should be an Excel sheet.

When you convert Excel sheet to CSV file, each tab in the sheet should be converted into a seperate CSV file. So that, each CSV file will contain the data from the corresponding tab in the Excel sheet.

When you create multiple CSV files, create new table for each sheet in Athen/Glue Database.

AWS
sai
已回答 2 个月前
  • Is it possible to do this with an Xlsx file? When I'm trying to query the file I get this error - UTF-8 encoding is required, which I don't get when the file is CSV

0

Is it possible to do this with an Xlsx file? When I'm trying to query the file I get this error - UTF-8 encoding is required, which I don't get when the file is CSV

已回答 2 个月前

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

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

回答问题的准则