QuestionQ202

VerifiedData Transformation, Cleansing, and Quality

Downstream consumers of a Delta Lake table have reported data-quality issues that are affecting performance in their applications. In particular, invalid latitude and longitude values in the activity_details table have prevented them from using other geolocation processes.

A junior engineer has written the following code to add CHECK constraints to the Delta Lake table:

Question Image

A senior engineer has confirmed that the preceding logic is correct and that the valid latitude and longitude ranges are provided, but the code fails when it runs.

Which statement accounts for this failure?

Explanation

Delta Lake permits CHECK constraints to be added to an existing table with ALTER TABLE ... ADD CONSTRAINT, but it validates the constraint against all existing rows before adding it. If any existing activity_details record has a latitude outside -90 through 90 or a longitude outside -180 through 180, the operation fails until those violations are remediated.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!