Ultimate access to all questions.
Upgrade Now 🚀
Sign in to unlock AI tutor
A data scientist is working on a Databricks notebook and needs to execute a Spark SQL query on a Delta table named 'customer_data.' The goal is to update specific rows based on a condition. Which code snippet should they use?
A
customer_data.update('column1 = 'new_value'', 'condition')
B
spark.sql('MERGE INTO customer_data USING updates_df ON condition WHEN MATCHED THEN UPDATE SET column1 = 'new_value'')
C
spark.sql('UPDATE customer_data SET column1 = 'new_value' WHERE condition')
D
customer_data.write.format('delta').mode('update').option('set', 'column1 = 'new_value'').save()