The downstream consumers of a Delta Lake table have been complaining about data quality issues impacting performance in their applications. Specifically, they have complained that invalid latitude and longitude values in the activity_details table have been breaking their ability to use other geolocation processes.
A junior engineer has written the following code to add CHECK constraints to the Delta Lake table:
A senior engineer has confirmed the above logic is correct and the valid ranges for latitude and longitude are provided, but the code fails when executed.
Which statement explains the cause of this failure?
- Because another team uses this table to support a frequently running application, two-phase locking is preventing the operation from committing.
- The activity_details table already exists; CHECK constraints can only be added during initial table creation.
- The activity_details table already contains records that violate the constraints; all existing data must pass CHECK constraints in order to add them to an existing table.
- The activity_details table already contains records; CHECK constraints can only be added prior to inserting values into a table.
- The current table schema does not contain the field valid_coordinates; schema evolution will need to be enabled before altering the table to add a constraint.
Reveal Solution Next Question