rdblue commented on code in PR #3188:
URL: https://github.com/apache/iceberg/pull/3188#discussion_r841295454


##########
format/view-spec.md:
##########
@@ -0,0 +1,264 @@
+<!--
+ - Licensed to the Apache Software Foundation (ASF) under one or more
+ - contributor license agreements.  See the NOTICE file distributed with
+ - this work for additional information regarding copyright ownership.
+ - The ASF licenses this file to You under the Apache License, Version 2.0
+ - (the "License"); you may not use this file except in compliance with
+ - the License.  You may obtain a copy of the License at
+ -
+ -   http://www.apache.org/licenses/LICENSE-2.0
+ -
+ - Unless required by applicable law or agreed to in writing, software
+ - distributed under the License is distributed on an "AS IS" BASIS,
+ - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ - See the License for the specific language governing permissions and
+ - limitations under the License.
+ -->
+
+# Iceberg View Spec
+
+## Background and Motivation
+
+Most compute engines (e.g. Trino and Apache Spark) support views. A view is a 
logical table that can be referenced by future queries. Views do not contain 
any data. Instead, the query stored by the view is executed every time the view 
is referenced by another query.
+
+Each compute engine stores the metadata of the view in its proprietary format 
in the metastore of choice. Thus, views created from one engine can not be read 
or altered easily from another engine even when engines share the metastore as 
well as the storage system. This document standardizes the view metadata for 
ease of sharing the views across engines.
+
+## Goals
+
+* A common metadata format for view metadata, similar to how Iceberg supports 
a common table format for tables.
+* The view metadata format specification
+  * Includes storage format as well as APIs to write/read the metadata.
+  * Supports versioning of views to track how a view evolved over time.
+
+## Overview
+
+View metadata storage mirrors how Iceberg table metadata is stored and 
retrieved. View metadata is maintained in metadata files. All changes to view 
state create a new view metadata file and completely replace the old metadata 
using an atomic swap. Like Iceberg tables, this atomic swap is delegated to the 
metastore that tracks tables and/or views by name. The view metadata file 
tracks the view schema, custom properties, current and past versions, as well 
as other metadata.
+Each metadata file is self-sufficient. It contains the history of the last few 
operations performed on the view and can be used to roll back the view to a 
previous version.

Review Comment:
   I think it is a little misleading to say the view metadata file "can be used 
to roll back the view to a previous version". Like tables, the view metadata 
files should only go forward. You can roll back by updating a pointer to an 
older version tracked in metadata but we do not want people to think that they 
can roll back by pointing to an older metadata file.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to