-1

I'm unable to get the CSV file data from the s3 bucket into AWS Athena.

I'm getting a schema for the file, not the data

Error message as no records returned.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470

1 Answers1

0

Amazon Athena directly reads data from Amazon S3.

You must first use CREATE TABLE to define the format and location of the data. You can then query against the table.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
  • Thanks, John for the response, I had created the table which is successful, but couldn't fetch the data from s3? – Pooja Pediredla Nov 05 '19 at 06:30
  • In that case, either the table definition is incorrect or is pointing to the wrong location, or the data in S3 is not accessible to you. Please edit your Question to show your `CREATE TABLE` statement and provide a (short) sample of the data you are trying to query. That way, we can attempt to reproduce your situation. Without this information, we are unable to offer you any suggestions. – John Rotenstein Nov 05 '19 at 23:26
  • Hello John, I have solved the problem, I did a mistake where I kept all my CSV files in a bucket directly so that it unable to identify which one, later on, I made a folder and kept all my CSV files into then I was able to fetch the data. But one of my CSV file includes headers, data is fetched with headers. can't we fetch the data without headers? – Pooja Pediredla Nov 06 '19 at 05:02
  • Yes, but it depends how you are defining the table. See: [Aws Athena - Create external table skipping first row - Stack Overflow](https://stackoverflow.com/questions/46452010/aws-athena-create-external-table-skipping-first-row) – John Rotenstein Nov 06 '19 at 05:20
  • Is there any link that helps me how to fetch data from glue data catalog? – Pooja Pediredla Nov 06 '19 at 12:22
  • @PoojaPediredla I'm not sure what you mean by that. Do you mean as a query? (Feel free to ask another Question with the details/example.) – John Rotenstein Nov 06 '19 at 20:18
  • Hi John, I have a scenario where I transfer 15GB of data into s3 and from s3 transfer to snowflake using either snow pipe or SAP data services on a daily bases. How it cost me? I've checked in the simple monthly calculator, but I got confused that the data transfer option is to apply for s3 standard storage or not? – Pooja Pediredla Nov 07 '19 at 05:36
  • Data Transfer applies to data being transferred from AWS to the Internet, or between AWS regions. This applies to any service (eg S3 files, EC2 web pages, etc). It is _not_ related to storage types. It applies to the volume of data sent to the Internet. – John Rotenstein Nov 07 '19 at 05:40