QuestionQ292

VerifiedData Transformation, Cleansing, and Quality

An upstream source writes Parquet data as hourly batches to directories named with the current date. A nightly batch job runs the following code to ingest all data from the preceding day, as indicated by the date variable:

Question Image

Assume that the fields customer_id and order_id serve as a composite key to uniquely identify each order.

If the upstream system is known to occasionally produce duplicate entries for a single order hours apart, which statement is correct?

Explanation

dropDuplicates(["customer_id", "order_id"]) removes duplicate composite keys only from the incoming DataFrame. Append mode adds that deduplicated batch to the target table without checking it against rows already in the table, so newly written records may duplicate records that were appended previously.

Learn more

Community Discussion

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