
Ultimate access to all questions.
Downstream consumers of a Delta Lake table are reporting data quality issues affecting their application performance, particularly due to invalid latitude and longitude values in the activity_details table. A junior engineer attempted to add CHECK constraints with the following code, which fails despite correct logic for valid coordinate ranges (-90 to 90 for latitude, -180 to 180 for longitude):
ALTER TABLE activity_details
ADD CONSTRAINT valid_coordinates
CHECK (
latitude >= -90 AND
latitude <= 90 AND
longitude >= -180 AND
longitude <= 180
);
ALTER TABLE activity_details
ADD CONSTRAINT valid_coordinates
CHECK (
latitude >= -90 AND
latitude <= 90 AND
longitude >= -180 AND
longitude <= 180
);
What is the reason for this execution failure?_
A
Because another team uses this table to support a frequently running application, two-phase locking is preventing the operation from committing.
B
The activity_details table already exists; CHECK constraints can only be added during initial table creation._
C
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._
D
The activity_details table already contains records; CHECK constraints can only be added prior to inserting values into a table._
E
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._