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

demandé il y a 2 mois170 vues
2 réponses
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
répondu il y a 2 mois
  • 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

répondu il y a 2 mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions