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달 전

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

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

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

관련 콘텐츠