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

feita há 2 meses170 visualizações
2 Respostas
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
respondido há 2 meses
  • 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

respondido há 2 meses

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas