
Answer-first summary for fast verification
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';
The `ALTER TABLE ... ADD PARTITION` statement in Amazon Athena allows you to explicitly add specific partitions to the table metadata without having to scan the entire Amazon S3 location. `MSCK REPAIR TABLE` (Option B) scans all folders in the table's S3 path to find new partitions, which can be very time-consuming and costly for large datasets. Option D is incorrect syntax for adding new partitions.
Author: Ritesh Yadav
Ultimate access to all questions.
Question 24
A data engineer creates an AWS Glue Data Catalog table by using an AWS Glue crawler that is named Orders. The data engineer wants to add the following new partitions:
A
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';
B
MSCK REPAIR TABLE Orders;
C
REPAIR TABLE Orders;
D
ALTER TABLE Orders MODIFY PARTITION(order_date='2023-01-01') LOCATION 's3://transactions/orders/2023-01-01'; ALTER TABLE Orders MODIFY PARTITION(order_date='2023-01-02') LOCATION 's3://transactions/orders/2023-01-02';
No comments yet.