QuestionQ163

VerifiedDeveloping Code for Data Processing using Python and SQL

The following table contains items found in users’ carts on an e-commerce website.

Question Image

The following MERGE statement updates this table using an updates view, with schema evolution enabled for the table.

Question Image

How is the following update handled?

Question Image

Explanation

Delta Lake schema evolution during MERGE with UPDATE SET * adds source fields that are absent from the target, including nested fields within structs. The new coupon field is added to the items struct, while existing unmatched records are read with NULL for that field; a full rewrite of the existing underlying files is not required.

Learn more

Community Discussion

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