nerdexam
Databricks

CERTIFIED-DATA-ENGINEER-PROFESSIONAL · Question #79

A CHECK constraint has been successfully added to the Delta table named activity_details using the following logic: A batch job is attempting to insert new records to the table, including a record…

The correct answer is B. The write will fail completely because of the constraint violation and no records will be inserted. The CHECK constraint is used to ensure that the data inserted into the table meets the specified conditions. In this case, the CHECK constraint is used to ensure that the latitude and longitude values are within the specified range. If the data does not meet the specified…

Delta Lake Data Management

Question

A CHECK constraint has been successfully added to the Delta table named activity_details using the following logic:

A batch job is attempting to insert new records to the table, including a record where latitude = 45.50 and longitude = 212.67. Which statement describes the outcome of this batch insert?

Exhibit

CERTIFIED-DATA-ENGINEER-PROFESSIONAL question #79 exhibit

Options

  • AThe write will fail when the violating record is reached; any records previously processed will be
  • BThe write will fail completely because of the constraint violation and no records will be inserted
  • CThe write will insert all records except those that violate the table constraints; the violating records
  • DThe write will include all records in the target table; any violations will be indicated in the boolean
  • EThe write will insert all records except those that violate the table constraints; the violating records

How the community answered

(56 responses)
  • A
    2% (1)
  • B
    89% (50)
  • C
    5% (3)
  • D
    4% (2)

Explanation

The CHECK constraint is used to ensure that the data inserted into the table meets the specified conditions. In this case, the CHECK constraint is used to ensure that the latitude and longitude values are within the specified range. If the data does not meet the specified conditions, the write operation will fail completely and no records will be inserted into the target table. This is because Delta Lake supports ACID transactions, which means that either all the data is written or none of it is written. Therefore, the batch insert will fail when it encounters a record that violates the constraint, and the target table will not be updated.

Topics

#Delta Lake#CHECK Constraint#Data Integrity#Batch Processing

Community Discussion

No community discussion yet for this question.

Full CERTIFIED-DATA-ENGINEER-PROFESSIONAL Practice