Skip to main content

Overview

Starting from release 0.5.0, Delta Sharing supports querying Change Data Feed (CDF) from shared tables. This enables you to track row-level changes (inserts, updates, deletes) between table versions.
CDF must be enabled by the data provider on the original Delta table. Once enabled and shared through Delta Sharing, recipients can query the change feed just like they would with a regular Delta table.

Basic CDF Queries

To read change data from a Delta Sharing table, use the readChangeFeed option:

Version Options

Control which versions to read using startingVersion and endingVersion:

Starting Version

Specify the first version to include in the change feed:

Ending Version

Specify the last version to include (inclusive):

Change Data Schema

The change data feed includes additional metadata columns beyond the table’s regular columns:

Understanding Change Types

Represents newly added rows to the table.

Complete Example

Here’s a comprehensive example analyzing customer data changes:

Common Use Cases

Incremental Data Processing

Change Audit Trail

Data Synchronization

Tracking Field-Level Changes

Filtering Change Data

You can apply filters to focus on specific changes:

Performance Considerations

Avoid reading the entire change history when you only need recent changes.
Filter for specific change types before other operations to reduce data volume.

Handling Update Pairs

When processing updates, you often need to handle preimage/postimage pairs:

Error Handling

Common Issues:
  • CDF not enabled: The data provider must enable CDF on the source table
  • Invalid versions: Ensure the specified versions exist in the table history
  • Version gaps: Some versions may not have changes if no operations occurred

Next Steps

Streaming

Stream live changes from shared tables

SQL Usage

Query shared tables with SQL