A data engineer is using an AWS Glue ETL job to remove outdated customer records from a table that contains customer account information. The data engineer is using the following SQL command:
MERGE INTO accounts t USING monthly_accounts_update s
ON t.customer = s.customer
WHEN MATCHED THEN DELETE
What will happen when the data engineer runs the SQL command?
In AWS Glue's SQL implementation (Spark SQL-compatible), the MERGE INTO statement supports conditional actions.
The clause WHEN MATCHED THEN DELETE deletes matching records from the target table (accounts) where the join condition is true.
''A MERGE INTO statement can perform updates, inserts, or deletes based on the match condition between source and target tables.''
-- Ace the AWS Certified Data Engineer - Associate Certification - version 2 - apple.pdf
Currently there are no comments in this discussion, be the first to comment!