- Più recenti
- Maggior numero di voti
- Maggior numero di commenti
It is happening because the partitions are not created properly.
Partitioning can be done in two ways - Dynamic Partitioning and Static Partitioning.
For dynamic partitioning, your folder structure should be of the form:
s3://mybucket/year=2017/month=06/day=01/hour=01
In this case, when you'll run "MSCK REPAIR TABLE test_tables" query after creating table, the partitions will be identified automatically.
Since your folder structure is :
s3://mybucket/2017/06/01/01
You need to add partitions manually after creating table and before executing repair table query. This can be done using the following query:
ALTER TABLE test_tables ADD PARTITION (year='2017',month='06',day='01',hour='01') location 's3://mybucket/2017/06/01/01'
For more details refer -
http://docs.aws.amazon.com/athena/latest/ug/partitions.html
Correct. The MSCK repair table only works if your prefixes on S3 are in a key=value format. Else you need to manually add partitions. Also, if you are in US-East-1 you can also use Glue to automatically recognize schemas/partitions. See http://docs.aws.amazon.com/athena/latest/ug/glue-faq.html
Contenuto pertinente
- AWS UFFICIALEAggiornata 3 anni fa
- AWS UFFICIALEAggiornata 9 mesi fa
- AWS UFFICIALEAggiornata 2 anni fa
- AWS UFFICIALEAggiornata 2 anni fa