0

I have tried this not achieving required results- I have multiple CSV files in a folder of s3 bucket but when it creates multiple table for it then Athena returns zero results so I made a different folder for each file then it works fine. problem- but if in future more folders will be added then I have to go to crawler and have to add a new location path for each newly added folder so is there any way to do it automatically or some other way to do it. I am using glue crawler and s3 bucket athena for query run on multiple CSV files.

Nmk
  • 1,281
  • 2
  • 14
  • 25
meeta
  • 3
  • 3

1 Answers1

0

In general a table needs all of its files to be in a directory, and no other files to be in that directory.

There is however, a mechanism that makes it possible to create tables that include just specific files. You can read more about that in the the second part of this answer: Partition Athena query by S3 created date (scroll down a bit after the horizontal rule). You can also find an example in the S3 Inventory documentation: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html

Theo
  • 131,503
  • 21
  • 160
  • 205