Skip to content

View: Add StorageTableIdentifier and storage-table field to ViewVersion (MV spec, part 1) #15523

Open
osscm wants to merge 1 commit intoapache:mainfrom
osscm:mv_part1
Open

View: Add StorageTableIdentifier and storage-table field to ViewVersion (MV spec, part 1) #15523
osscm wants to merge 1 commit intoapache:mainfrom
osscm:mv_part1

Conversation

@osscm
Copy link

@osscm osscm commented Mar 6, 2026

Summary

First in a series of incremental PRs toward implementing the Iceberg Materialized View
spec (#11041). We wanted to share our approach early and welcome feedback from the
community and the spec author before going further.

Per the spec, a materialized view is a standard Iceberg view whose ViewVersion carries
an optional storage-table field pointing to a regular Iceberg table holding precomputed
query results. When absent, the entity is a plain logical view — fully backward compatible.

Changes in this PR:

  • StorageTableIdentifier — new value class (namespace, name, optional catalog)
  • ViewVersion — new default storageTable() returning null for plain views
  • BaseViewVersion — exposes @Nullable storageTable() for Immutables
  • ViewVersionParser — serializes/deserializes the storage-table JSON field

Spec Reference

#11041 — Materialized View Spec (thanks @JanKaul and all PMC/community for driving this!)

Proposed Implementation Plan

We are planning to implement the spec incrementally and would love early input on
whether this direction looks right to the community. Here is what we are thinking:

  • Part 1 (this PR): StorageTableIdentifier + storage-table field on ViewVersion
  • Part 2: RefreshState + SourceState data classes (snapshot summary post-refresh)
  • Part 3: MaterializedView interface extending View
  • Part 4: Catalog API — MV lifecycle methods in ViewCatalog
  • Part 5: Catalog implementations (REST, JDBC, Hive)
  • Part 6: Spark integration + SQL DDL (CREATE MATERIALIZED VIEW, REFRESH, DROP)

We are happy to adjust the approach, merge steps, or re-sequence based on feedback.

Test Plan

  • ./gradlew :iceberg-api:test --tests "org.apache.iceberg.view.TestStorageTableIdentifier"
  • ./gradlew :iceberg-core:test --tests "org.apache.iceberg.view.TestViewVersionParser"

…on (MV spec, part 1)

Introduces foundational data model for Materialized View support per the
MV spec (apache#11041). Adds StorageTableIdentifier, extends
ViewVersion with an optional storage-table field, updates the parser, and
adds tests. Plain views are fully backward compatible (storageTable() returns null).
@osscm
Copy link
Author

osscm commented Mar 6, 2026

cc @anuragmantri
cc @wmoustafa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant