QuestionQ248

VerifiedData Transformation, Cleansing, and Quality

A task orchestrator is configured to run two hourly tasks. First, an external system writes Parquet data to a directory mounted at /mnt/raw_orders/. After the data has been written, a Databricks job that contains the following code runs:

Question Image

Assume that customer_id and order_id together form a composite key that uniquely identifies each order, and that time represents when the record was queued in the source system.

If the upstream system is known to sometimes enqueue duplicate entries for one order several hours apart, which statement is correct?

Explanation

A two-hour event-time watermark limits the state retained for streaming dropDuplicates on customer_id and order_id. Once state for an earlier key is removed after the watermark advances, a duplicate arriving more than two hours later may not be recognized as a duplicate and can be retained in the target table.

Learn more

Community Discussion

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