QuestionQ56

VerifiedData Ingestion & Acquisition

A data engineer is configuring a pipeline to ingest data from a message bus system that occasionally sends duplicate messages. Duplicate messages can arrive a week apart. The destination is a Databricks Delta Lake table in which every record must appear exactly once.

Which Databricks ingestion pattern should be used to handle possible duplicates when events may arrive outside the configured watermark?

Explanation

Streaming deduplication state is removed after the watermark threshold, so dropDuplicates cannot guarantee detection of duplicates that arrive later than that threshold. An insert-only MERGE INTO using a stable unique event key matches against the persistent Delta Lake target and inserts only keys not already present, providing durable deduplication independent of watermark state. Databricks documents insert-only merge as a pattern for continuous log deduplication.

Learn more

Community Discussion

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