Repository navigation
Conversation
62ba549 to
b986cf0
Compare
90f517e to
2790b0d
Compare
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions. |
|
This pull request has been closed due to lack of activity. This is not a judgement on the merit of the PR in any way. It is just a way of keeping the PR queue manageable. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time. |
2790b0d to
af76391
Compare
szehon-ho
left a comment
There was a problem hiding this comment.
Thanks, one more minor suggestion
af76391 to
521477f
Compare
|
When materialized view is created, two entities would be added to the catalog - a view and a storage table. From the engine perspective it is important to expose it as a single object during listing. Are there any rules how catalog implementors should deal with these objects? E.g., shall we expose the view via |
|
Yes correct, the idea is to filter-out the storage-table for the |
Co-authored-by: Daniel Weeks <daniel.weeks@databricks.com>
- Define freshness as a universal property: storage table equals the result of the current view query (at the MV's current view-version-id) over the current state of dependencies. - Define dependencies objectively by parsing the SQL: base tables, views (transitively expanded), and intermediate materialized views (treated as their storage tables with recursive freshness via their own refresh-state). Drop the producer-relative dependency framing. - Reorganize the freshness section into producer flexibility and consumer options. Producer chooses what to record; consumer chooses what to verify. Producer-first ordering matches the chronological flow. - Tighten the schema: intermediate materialized views are recorded as a single table entry referencing the storage table; recording as a view entry is not permitted. - Crisp read-decision rule: if a consumer's assessment passes, it reads from the storage table; otherwise it evaluates the view query in place of the storage table. - Replace the "consumer/producer behavior" prose under Freshness with Producer flexibility and Consumer options subsections that match the three reference verification paths (recency policy, trust, verify). - Add Appendix B "What counts as a dependency" with the SQL-derived dependency rules and a worked example showing the recursive boundary for intermediate materialized views.
Co-authored-by: Daniel Weeks <daniel.weeks@databricks.com>
Co-authored-by: Daniel Weeks <daniel.weeks@databricks.com>
- make source table snapshot-id optional (empty source tables) - define ref semantics for branch/tag tracking vs pinned snapshots - note storage-table field is backward compatible for MV-unaware readers - fix C/D materialized view example and spec/typo nits
f14886b to
ba28913
Compare
| } ], | ||
| "storage-table" : { | ||
| "namespace" : [ "default" ], | ||
| "name" : "event_agg_mv__storage" |
There was a problem hiding this comment.
it is worthwhile to point out explicitly in the text that it is the writer's responsibility to create the storage table event_agg_mv__storage.
|
|
||
| ### Strategy 2: Treat nested materialized views as tables | ||
|
|
||
| Same as Strategy 1, but the query reads from materialized views. The producer stops at each MV boundary and records the MV's storage table snapshot ID and view version ID. No expansion beyond the MV. |
There was a problem hiding this comment.
the query reads from materialized views
the query reads from materialized views storage tables.
|
|
||
| ### Strategy 3: Treat nested materialized views as views | ||
|
|
||
| Same as Strategy 1, but the query reads from materialized views. The producer treats each materialized view as a regular view: expand through the MV's view definition and record the underlying tables and views. The MV's storage table snapshot ID is **not** recorded. |
There was a problem hiding this comment.
but the query reads from materialized views
but the query expands recursively the view queries corresponding to the materialized views.
Generated-by: Claude Code Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| | _optional_ | `snapshot-id` | The snapshot-id of the source table that was read during the refresh operation. Omitted when the source table had no snapshots at refresh time (e.g. a newly created, empty table) | | ||
| | _optional_ | `ref` | Branch name of the source table being referenced in the view query | | ||
|
|
||
| When `ref` is set, the source table is tracked against that branch or tag, and the materialized view is stale once the ref advances past the recorded `snapshot-id`. When `ref` is not set, the source table is pinned to the recorded `snapshot-id` (e.g. `FOR VERSION AS OF <snapshot-id>`); the materialized view remains fresh with respect to this source as long as that snapshot exists. Producers that read a branch should record the branch name in `ref`. |
There was a problem hiding this comment.
the materialized view remains fresh with respect to this source as long as that snapshot exists.
I think this is overly strong statement. It again tries to define "freshness".
|
|
||
| ### Strategy 5: Skip non-Iceberg dependencies | ||
|
|
||
| The producer records only Iceberg sources and omits non-Iceberg dependencies entirely. Useful when the view query reads from a mix of Iceberg and non-Iceberg sources and the producer chooses to track only the Iceberg side. |
Generated-by: Claude Code
f1ef761 to
75cb171
Compare
This PR implements the Iceberg Materialized View Proposal #10043 by adding a section for Materialized Views to the View spec. It follows the design of the proposal document.
The idea is to resolve any remaining questions before starting the voting process on the dev list.