A data engineer used an AWS Glue crawler named Orders to create a Glue Data Catalog table. The engineer must add these new partitions: s3://transactions/orders/order_date=2023-01-01 and s3://transactions/orders/order_date=2023-01-02. The metadata should be updated to include the new partitions without scanning all folders and files under the table location. Which Amazon Athena DDL statement should the engineer run?
Choose an answer
Tap an option to check your answer.
Correct answer: ALTER TABLE Orders ADD PARTITION (order_date='2023-01-01') LOCATION 's3://transactions/orders/order_date=2023-01-01'; ALTER TABLE Orders ADD PARTITION (order_date='2023-01-02') LOCATION 's3://transactions/orders/order_date=2023-01-02';.
Why this is the answer
The ALTER TABLE ADD PARTITION statement is the correct way to manually add new partitions to an Athena table. It allows you to specify the partition key-value pairs and the exact S3 location for each new partition, updating the Glue Data Catalog without rescanning the entire dataset. This is efficient when you know the new partition paths. MSCK REPAIR TABLE (or ALTER TABLE RECOVER PARTITIONS) is used to discover new partitions that have been added to the S3 location but are not yet registered in the Glue Data Catalog. It scans the table's S3 path to find new partitions, which is not desired here as the requirement is to avoid scanning all folders and files. REPAIR TABLE is not a standard Athena DDL command for managing partitions. ALTER TABLE MODIFY PARTITION is used to change properties of an existing partition, not to add new ones.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed