Skip to the page

Databricks interview question · hard

You've set up a Delta Live Table pipeline. If you modify the source data while the pipeline is running, what will happen to the pipeline's execution?

The short answerThis is a great question that gets at the heart of how Delta Live Tables (DLT) handles data updates.

The full answer

This is a great question that gets at the heart of how Delta Live Tables (DLT) handles data updates. Here's what happens when you modify source data while a DLT pipeline is running:


DLT's Behavior with Source Data Changes

  • Incremental Processing:
    DLT is designed for incremental data processing. It doesn't reprocess the entire dataset every time it runs. Instead, it tracks changes in the source data and processes only the new or changed data.

  • Data Versioning:
    DLT leverages Delta Lake's versioning capabilities. It keeps track of which version of the source data has been processed. When the pipeline runs again, it identifies the new versions and processes only those changes.

  • Pipeline Updates:
    When you modify the source data, DLT will detect these changes during the next pipeline update. You can trigger updates manually or schedule them to run automatically.


Behavior During Pipeline Execution

  • For Streaming Sources (e.g., Kafka, Auto Loader):
    DLT will continue to process the incoming stream of data, including the modifications. The pipeline will incorporate the changes as they arrive.

  • For Batch Sources (e.g., Delta tables, Parquet files):
    DLT typically processes a snapshot of the data at the start of the pipeline run. If you modify the source data during the run, those changes will not be reflected in the current pipeline execution. The changes will be picked up in the next pipeline update.


Key Considerations

  • Idempotency:
    DLT aims for idempotency, meaning that running the pipeline multiple times with the same input data should produce the same results. This is important for ensuring data consistency and preventing unintended side effects.

  • Data Freshness:
    The frequency of pipeline updates determines how quickly changes in the source data are reflected in the target tables. You can adjust the update frequency based on your data freshness requirements.

  • Continuous vs. Triggered Updates:
    DLT supports both continuous and triggered updates. Continuous updates process data as it arrives, while triggered updates run on a schedule or on demand.


Source: - Delta Live Tables - How Delta Live Tables Works

Last updated 17 January 2025