Skip to content

Graph-source time travel: per-view pins so one query can read a table at two snapshots #1906

Open

Description

@bplatz

Summary

A query can read a graph source (Iceberg table) at only one state. #1896 carries a time pin as a per-query, per-source entry on the R2RML table provider (R2rmlTableProvider::pin_source_time), not on the engine's GraphRef per view. So a query that names the same table at two states is refused. That includes two aliased named views:

"fromNamed": [
  {"@id": "orders@snapshot:A", "alias": "old"},
  {"@id": "orders",            "alias": "new"}
]

→ 400, "pinned to two different states in one query".

That shape is the "what changed in this table between two snapshots" query. Native ledgers already support it (two fromNamed views at different @t:), so graph sources and ledgers now differ in what time travel can express. The refusal is loud rather than wrong: nothing silently returns the wrong snapshot.

Proposed direction

Carry the pin on the view (GraphRef / the R2RML operator's graph reference) and resolve the snapshot per scan, instead of in a per-query side table on the provider. That removes pin_source_time and the two-states refusal. It spans the query crate (operator and provider trait) and the API crate (view construction, provider). The catalog session's one-snapshot-per-table pin would become one per (table, pin).

Delta (#1899) inherits the same limitation through the same trait, so the decision covers both formats.

Decision needed

Whether snapshot-diff queries over lakehouse sources are something we want to support, and if so, when (before or after Delta lands).

Raised in review of #1896.

Activity

  1. added
    enhancement
    P3
    triage:needs-decision
    area:iceberg
    on Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3area:icebergenhancementtriage:needs-decision

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions