Skip to main content
The IncrementalAppendScan interface provides an API for reading only the data appended between two snapshots in an Iceberg table.

Overview

IncrementalAppendScan is designed for incremental processing workflows where you need to read only the new data added since the last processed snapshot. This is useful for streaming pipelines, change data capture (CDC), and incremental ETL jobs.

Interface

Core Methods

IncrementalAppendScan inherits all methods from IncrementalScan:

fromSnapshotInclusive()

Instructs this scan to look for changes starting from a particular snapshot (inclusive).
Parameters:
  • fromSnapshotId - The start snapshot ID (inclusive)
Returns: This scan for method chaining Throws: IllegalArgumentException if the start snapshot is not an ancestor of the end snapshot Example:

fromSnapshotInclusive() with Reference

Instructs this scan to look for changes starting from a particular snapshot reference (inclusive).
Parameters:
  • ref - The start ref name that points to a particular snapshot ID (inclusive)
Returns: This scan for method chaining Throws: IllegalArgumentException if the start snapshot is not an ancestor of the end snapshot

fromSnapshotExclusive()

Instructs this scan to look for changes starting from a particular snapshot (exclusive).
Parameters:
  • fromSnapshotId - The start snapshot ID (exclusive)
Returns: This scan for method chaining Throws: IllegalArgumentException if the start snapshot is not an ancestor of the end snapshot Example:

fromSnapshotExclusive() with Reference

Instructs this scan to look for changes starting from a particular snapshot reference (exclusive).
Parameters:
  • ref - The start ref name that points to a particular snapshot ID (exclusive)
Returns: This scan for method chaining

toSnapshot()

Instructs this scan to look for changes up to a particular snapshot (inclusive).
Parameters:
  • toSnapshotId - The end snapshot ID (inclusive)
Returns: This scan for method chaining Example:

toSnapshot() with Reference

Instructs this scan to look for changes up to a particular snapshot reference (inclusive).
Parameters:
  • ref - The end snapshot ref (inclusive)
Returns: This scan for method chaining

useBranch()

Specifies the branch to use for the incremental scan.
Parameters:
  • branch - The branch name
Returns: This scan for method chaining

Examples

Basic Incremental Scan

Streaming Incremental Processing

Processing Appends in Time Range

Branch-Based Incremental Scan

Incremental Scan with Filters

Reading All Historical Appends

Inclusive vs Exclusive Boundaries

Checkpointing Pattern

Use Cases

IncrementalAppendScan is ideal for:
  1. Streaming ETL Pipelines - Process only new data since last run
  2. Change Data Capture - Track appended records over time
  3. Incremental Analytics - Update aggregations with new data only
  4. Event Processing - Process new events in chronological order
  5. Data Replication - Sync only new data to downstream systems

See Also