Certified Data Engineer Professional Exam QuestionsBrowse all questions from this exam

Certified Data Engineer Professional Exam - Question 38


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?

Show Answer
Correct Answer: BC

The operation fails because the activity_details table already contains records that violate the constraints. In Delta Lake, when adding a CHECK constraint to an existing table, all existing data must comply with the new constraints. If any records in the table do not meet the constraint conditions specified, the operation will fail. Therefore, before adding the CHECK constraints, it is necessary to ensure that all existing records meet the constraints or modify the records accordingly.

Discussion

14 comments
Sign in to comment
8605246Option: C
Aug 6, 2023

incorrect the correct option is C, with constraints, if added to an existing table the existing data in the table must be consistent with the constraint otherwise it fails https://docs.databricks.com/en/sql/language-manual/sql-ref-syntax-ddl-alter-table.html#add-constraint

aragorn_bregoOption: C
Nov 21, 2023

When adding a CHECK constraint to an existing table, the operation will fail if there are any rows in the table that do not meet the constraint. Before a CHECK constraint can be added, the data already in the table must be validated to ensure that it complies with the constraint conditions. If any existing records violate the new constraints, they must be corrected or removed before the ALTER TABLE command can be successfully executed.

MarceloManhaesOption: C
Sep 24, 2023

Yes the correct is option C

sturcuOption: C
Oct 16, 2023

C - table already has data

QuadronoidOption: C
Oct 30, 2023

Right answer is C

BIKRAM063Option: C
Nov 2, 2023

Correct option C : existing data violated check constraint condition

EnduresoulOption: C
Nov 25, 2023

C is correct

hamzaKhribiOption: C
Dec 3, 2023

C is correct

PatitoOption: C
Dec 29, 2023

C is correct

kz_dataOption: C
Jan 10, 2024

C is the correct answer

Jay_98_11Option: C
Jan 13, 2024

correct

AziLaOption: C
Jan 28, 2024

correct ans is C

DAN_HOption: C
Feb 2, 2024

correct ans is C

PrashantTiwariOption: C
Feb 9, 2024

C is correct