rymurr commented on a change in pull request #3188: URL: https://github.com/apache/iceberg/pull/3188#discussion_r748301696
########## File path: site/docs/view-spec.md ########## @@ -0,0 +1,254 @@ +<!-- + - 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. + --> + +# View Support in Iceberg + +## Background and Motivation + +Most compute engines (e.g. Trino and Apache Spark ) support logical views, commonly known as ‘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. Views and tables occupy the same namespace. +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 + +### Storage Format + +The view metadata storage and retrieval mirrors how Iceberg table metadata is stored and retrieved. The view metadata is stored in a JSON file on S3 for ease of tracking the evolution of the view. Metastore continues to hold the view object with some properties such as database name, owner, create time, last access time and an indication that the object is a view. + +Each ‘CREATE OR REPLACE VIEW’ statement creates a new view version metadata file for that view. The view version metadata file has following fields: + + +| Required/Optional | Field Name | Description | +|-------------------|------------|-------------| +| Required | format-version | Json format version number for the view metadata spec. The view metadata spec and the corresponding format-version is independent of table spec. Starts with 1 and is incremented when there is a breaking change to view metadata. | +| Required | object-type | String identifying the type of object this metadata file is for. ‘View’ for all objects covered in this spec. | Review comment: does the table spec need to be updated to add this field also? ########## File path: site/docs/view-spec.md ########## @@ -0,0 +1,254 @@ +<!-- + - 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. + --> + +# View Support in Iceberg + +## Background and Motivation + +Most compute engines (e.g. Trino and Apache Spark ) support logical views, commonly known as ‘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. Views and tables occupy the same namespace. +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 + +### Storage Format + +The view metadata storage and retrieval mirrors how Iceberg table metadata is stored and retrieved. The view metadata is stored in a JSON file on S3 for ease of tracking the evolution of the view. Metastore continues to hold the view object with some properties such as database name, owner, create time, last access time and an indication that the object is a view. + +Each ‘CREATE OR REPLACE VIEW’ statement creates a new view version metadata file for that view. The view version metadata file has following fields: + + +| Required/Optional | Field Name | Description | +|-------------------|------------|-------------| +| Required | format-version | Json format version number for the view metadata spec. The view metadata spec and the corresponding format-version is independent of table spec. Starts with 1 and is incremented when there is a breaking change to view metadata. | +| Required | object-type | String identifying the type of object this metadata file is for. ‘View’ for all objects covered in this spec. | +| Required | location | Location of the view metadata files | +| Required | current-version-id | Current / latest version of the view. Set to ‘1’ when the view is first created. | +| Optional | properties | A string to string map of view properties. Contains pre-set properties such as ‘comment’ describing the view, does not contain arbitrary metadata. | +| Required | versions | An array of structs describing the last few versions of the view. Controlled by the table property: “version.history.num_entries”. See more below. | +| Required | version-log | An array of structs describing the log of created versions. See more below. | +| Optional | schemas | A list of schemas and alias-comment maps stored as objects with schema-id. See more below | +| Optional | current-schema-id | ID of the current schema of the view | + + +‘schemas’ is an array of structs with a field as shown below: Review comment: dumb question, why is this optional? ########## File path: site/docs/view-spec.md ########## @@ -0,0 +1,254 @@ +<!-- + - 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. + --> + +# View Support in Iceberg + +## Background and Motivation + +Most compute engines (e.g. Trino and Apache Spark ) support logical views, commonly known as ‘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. Views and tables occupy the same namespace. +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 + +### Storage Format + +The view metadata storage and retrieval mirrors how Iceberg table metadata is stored and retrieved. The view metadata is stored in a JSON file on S3 for ease of tracking the evolution of the view. Metastore continues to hold the view object with some properties such as database name, owner, create time, last access time and an indication that the object is a view. Review comment: Rather than refer to a specific technology I suggest a generic storage name ```suggestion The view metadata storage and retrieval mirrors how Iceberg table metadata is stored and retrieved. The view metadata is stored in a JSON file on object storage for ease of tracking the evolution of the view. Metastore continues to hold the view object with some properties such as database name, owner, create time, last access time and an indication that the object is a view. ``` ########## File path: site/docs/view-spec.md ########## @@ -0,0 +1,253 @@ +<!-- + - 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. + --> + +# View Support in Iceberg + +## Background and Motivation +Most compute engines (e.g. Trino and Apache Spark ) support logical views, commonly known as ‘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. Views and tables occupy the same namespace. +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 proposes standardizing the view metadata for ease of sharing the views across engines. + +### Goals +* Propose a common metadata format for view metadata, similar to how Iceberg supports a common table format for tables. The common metadata format specification Includes storage format as well as APIs to write/read the metadata +* Support versioning of views to track how a view evolved over time + +## Proposal + +### Storage Format + +The view metadata storage and retrieval mirrors how Iceberg table metadata is stored and retrieved. The view metadata is stored in a JSON file on S3 for ease of tracking the evolution of the view. Metastore continues to hold the view object with some properties such as database name, owner, create time, last access time and an indication that the object is a view. + +Each ‘CREATE OR REPLACE VIEW’ statement creates a new view version metadata file for that view. The view version metadata file has following fields: + + +| Required/Optional | Field Name | Description | +|-------------------|------------|-------------| +| Required | format-version | Json format version number for the view metadata spec. The view metadata spec and the corresponding format-version is independent of table spec. Starts with 1 and is incremented when there is a breaking change to view metadata. | +| Required | object-type | String identifying the type of object this metadata file is for. ‘View’ for all objects covered in this spec. | +| Required | location | Location of the view metadata files | +| Required | current-version-id | Current / latest version of the view. Set to ‘1’ when the view is first created. | +| Optional | properties | A string to string map of view properties. Contains pre-set properties such as ‘comment’ describing the view, does not contain arbitrary metadata. | +| Required | versions | An array of structs describing the last few versions of the view. Controlled by the table property: “version.history.num_entries”. See more below. | +| Required | version-log | An array of structs describing the log of created versions. See more below. | +| Optional | schemas | A list of schemas and alias-comment maps stored as objects with schema-id. See more below | +| Optional | current-schema-id | ID of the current schema of the view | + + +‘schemas’ is an array of structs with a field as shown below: + +| Required/Optional | Field Name | Description | +|-------------------|------------|-------------| +| Optional | schema | An array of structs describing the schema of the view. This field is the same as the ‘schema’ field from Iceberg table spec. See more below. | + + +‘Versions’ is an array of structs with fields as shown below: + +| Required/Optional | Field Name | Description | +|-------------------|------------|-------------| +| Required | version-id | Monotonically increasing id indicating the version of the view. Starts with “1”. | +| Required | timestamp-ms | Timestamp expressed in ms since epoch at which the version of the view was created. | +| Required | summary | A string to string map of view properties to track version metadata. This field can be used by engines to store any necessary properties. Two currently required properties are described below. | +| Required | sql | A string representing SQL definition of the view as input | Review comment: I agree @jzhuge that we shouldn't define a ton of representations up front. Though I am not sure what the downside of @jacques-n proposal is. Specifically: adding `sql` type and `dialect`. It is likely that all initial implementations would only contain 1 element in the list and only the dialect that the view was created by. But thats ok, we could add features to extend that list later: dialect translation or substrait etc. I am not sure what the `OriginalSql` above would be? To me we have to specify a dialect so others know if they can read the sql or not right? ########## File path: site/docs/view-spec.md ########## @@ -0,0 +1,254 @@ +<!-- + - 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. + --> + +# View Support in Iceberg + +## Background and Motivation + +Most compute engines (e.g. Trino and Apache Spark ) support logical views, commonly known as ‘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. Views and tables occupy the same namespace. +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 + +### Storage Format + +The view metadata storage and retrieval mirrors how Iceberg table metadata is stored and retrieved. The view metadata is stored in a JSON file on S3 for ease of tracking the evolution of the view. Metastore continues to hold the view object with some properties such as database name, owner, create time, last access time and an indication that the object is a view. + +Each ‘CREATE OR REPLACE VIEW’ statement creates a new view version metadata file for that view. The view version metadata file has following fields: + + +| Required/Optional | Field Name | Description | +|-------------------|------------|-------------| +| Required | format-version | Json format version number for the view metadata spec. The view metadata spec and the corresponding format-version is independent of table spec. Starts with 1 and is incremented when there is a breaking change to view metadata. | +| Required | object-type | String identifying the type of object this metadata file is for. ‘View’ for all objects covered in this spec. | +| Required | location | Location of the view metadata files | +| Required | current-version-id | Current / latest version of the view. Set to ‘1’ when the view is first created. | +| Optional | properties | A string to string map of view properties. Contains pre-set properties such as ‘comment’ describing the view, does not contain arbitrary metadata. | +| Required | versions | An array of structs describing the last few versions of the view. Controlled by the table property: “version.history.num_entries”. See more below. | +| Required | version-log | An array of structs describing the log of created versions. See more below. | +| Optional | schemas | A list of schemas and alias-comment maps stored as objects with schema-id. See more below | +| Optional | current-schema-id | ID of the current schema of the view | + + +‘schemas’ is an array of structs with a field as shown below: + +| Required/Optional | Field Name | Description | +|-------------------|------------|-------------| +| Optional | schema | An array of structs describing the schema of the view. This field is the same as the ‘schema’ field from Iceberg table spec. See more below. | + + +‘Versions’ is an array of structs with fields as shown below: + +| Required/Optional | Field Name | Description | +|-------------------|------------|-------------| +| Required | version-id | Monotonically increasing id indicating the version of the view. Starts with “1”. | +| Required | timestamp-ms | Timestamp expressed in ms since epoch at which the version of the view was created. | +| Required | summary | A string to string map of view properties to track version metadata. This field can be used by engines to store any necessary properties. Two currently required properties are described below. | +| Required | sql | A string representing SQL definition of the view as input | +| Required | dialect | A string specifying the dialect of the ‘sql’ field above. Used by engines to perform necessary translations to the SQL dialect supported by the engine. | +| Required | default-catalog | A string that specifies the catalog of the user session when the view was created / replaced. Used to resolve the tables used in the view definition. | +| Required | default-namespace | An array of strings indicating namespace at the time view was created / replaced. Used similar to ‘default-catalog’ above. | +| Optional | field-aliases | A list of strings of field aliases E.g. a list of alias_name info specified in the following create view statement. `CREATE VIEW v (alias_name COMMENT 'docs', alias_name2, ...) AS SELECT ...` | +| Optional | field-docs | A list of strings of field comments E.g. a list of ‘comment’ info specified in the following create view statement. `CREATE VIEW v (alias_name COMMENT 'docs', alias_name2, ...) AS SELECT ...` | + + +Note that each version is stored in a separate AVRO file. This is to ensure that the metadata file stays readable in the case the view definition is huge. As a future extension, an engine-agnostic intermediate representation or a serialized abstract syntax tree of the SQL definition may also be stored in each version, exacerbating the problem. + +“summary” is a string-string map with the following required keys. Engines may store additional key-value pairs in this map. + +| Required/Optional | Key | Value | +|-------------------|-----|-------| +| Required | operation |A string value indicating the view operation that caused this metadata to be created. Allowed values are “CREATE” and “REPLACE” | +| Required | engine-version | A string value indicating the version of the engine that performed the operation (create / replace) | Review comment: I guess this field is redundant if we go with the suggestion above for `representations`? ########## File path: site/docs/view-spec.md ########## @@ -0,0 +1,254 @@ +<!-- + - 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. + --> + +# View Support in Iceberg + +## Background and Motivation + +Most compute engines (e.g. Trino and Apache Spark ) support logical views, commonly known as ‘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. Views and tables occupy the same namespace. +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 + +### Storage Format + +The view metadata storage and retrieval mirrors how Iceberg table metadata is stored and retrieved. The view metadata is stored in a JSON file on S3 for ease of tracking the evolution of the view. Metastore continues to hold the view object with some properties such as database name, owner, create time, last access time and an indication that the object is a view. + +Each ‘CREATE OR REPLACE VIEW’ statement creates a new view version metadata file for that view. The view version metadata file has following fields: + + +| Required/Optional | Field Name | Description | +|-------------------|------------|-------------| +| Required | format-version | Json format version number for the view metadata spec. The view metadata spec and the corresponding format-version is independent of table spec. Starts with 1 and is incremented when there is a breaking change to view metadata. | +| Required | object-type | String identifying the type of object this metadata file is for. ‘View’ for all objects covered in this spec. | +| Required | location | Location of the view metadata files | +| Required | current-version-id | Current / latest version of the view. Set to ‘1’ when the view is first created. | +| Optional | properties | A string to string map of view properties. Contains pre-set properties such as ‘comment’ describing the view, does not contain arbitrary metadata. | +| Required | versions | An array of structs describing the last few versions of the view. Controlled by the table property: “version.history.num_entries”. See more below. | +| Required | version-log | An array of structs describing the log of created versions. See more below. | +| Optional | schemas | A list of schemas and alias-comment maps stored as objects with schema-id. See more below | +| Optional | current-schema-id | ID of the current schema of the view | + + +‘schemas’ is an array of structs with a field as shown below: + +| Required/Optional | Field Name | Description | +|-------------------|------------|-------------| +| Optional | schema | An array of structs describing the schema of the view. This field is the same as the ‘schema’ field from Iceberg table spec. See more below. | + + +‘Versions’ is an array of structs with fields as shown below: + +| Required/Optional | Field Name | Description | +|-------------------|------------|-------------| +| Required | version-id | Monotonically increasing id indicating the version of the view. Starts with “1”. | +| Required | timestamp-ms | Timestamp expressed in ms since epoch at which the version of the view was created. | +| Required | summary | A string to string map of view properties to track version metadata. This field can be used by engines to store any necessary properties. Two currently required properties are described below. | +| Required | sql | A string representing SQL definition of the view as input | +| Required | dialect | A string specifying the dialect of the ‘sql’ field above. Used by engines to perform necessary translations to the SQL dialect supported by the engine. | +| Required | default-catalog | A string that specifies the catalog of the user session when the view was created / replaced. Used to resolve the tables used in the view definition. | +| Required | default-namespace | An array of strings indicating namespace at the time view was created / replaced. Used similar to ‘default-catalog’ above. | +| Optional | field-aliases | A list of strings of field aliases E.g. a list of alias_name info specified in the following create view statement. `CREATE VIEW v (alias_name COMMENT 'docs', alias_name2, ...) AS SELECT ...` | Review comment: I am not sure I understand the purpose of this field. Could you please clarify? eg how would this alias be different from `aalias` in `select a as aalias from foo` ########## File path: site/docs/view-spec.md ########## @@ -0,0 +1,254 @@ +<!-- + - 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. + --> + +# View Support in Iceberg + +## Background and Motivation + +Most compute engines (e.g. Trino and Apache Spark ) support logical views, commonly known as ‘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. Views and tables occupy the same namespace. +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 + +### Storage Format + +The view metadata storage and retrieval mirrors how Iceberg table metadata is stored and retrieved. The view metadata is stored in a JSON file on S3 for ease of tracking the evolution of the view. Metastore continues to hold the view object with some properties such as database name, owner, create time, last access time and an indication that the object is a view. + +Each ‘CREATE OR REPLACE VIEW’ statement creates a new view version metadata file for that view. The view version metadata file has following fields: + + +| Required/Optional | Field Name | Description | +|-------------------|------------|-------------| +| Required | format-version | Json format version number for the view metadata spec. The view metadata spec and the corresponding format-version is independent of table spec. Starts with 1 and is incremented when there is a breaking change to view metadata. | +| Required | object-type | String identifying the type of object this metadata file is for. ‘View’ for all objects covered in this spec. | +| Required | location | Location of the view metadata files | +| Required | current-version-id | Current / latest version of the view. Set to ‘1’ when the view is first created. | +| Optional | properties | A string to string map of view properties. Contains pre-set properties such as ‘comment’ describing the view, does not contain arbitrary metadata. | +| Required | versions | An array of structs describing the last few versions of the view. Controlled by the table property: “version.history.num_entries”. See more below. | +| Required | version-log | An array of structs describing the log of created versions. See more below. | +| Optional | schemas | A list of schemas and alias-comment maps stored as objects with schema-id. See more below | +| Optional | current-schema-id | ID of the current schema of the view | + + +‘schemas’ is an array of structs with a field as shown below: + +| Required/Optional | Field Name | Description | +|-------------------|------------|-------------| +| Optional | schema | An array of structs describing the schema of the view. This field is the same as the ‘schema’ field from Iceberg table spec. See more below. | + + +‘Versions’ is an array of structs with fields as shown below: + +| Required/Optional | Field Name | Description | +|-------------------|------------|-------------| +| Required | version-id | Monotonically increasing id indicating the version of the view. Starts with “1”. | +| Required | timestamp-ms | Timestamp expressed in ms since epoch at which the version of the view was created. | +| Required | summary | A string to string map of view properties to track version metadata. This field can be used by engines to store any necessary properties. Two currently required properties are described below. | +| Required | sql | A string representing SQL definition of the view as input | +| Required | dialect | A string specifying the dialect of the ‘sql’ field above. Used by engines to perform necessary translations to the SQL dialect supported by the engine. | +| Required | default-catalog | A string that specifies the catalog of the user session when the view was created / replaced. Used to resolve the tables used in the view definition. | Review comment: This was brought up on the original proposal as well, these two fields seem a bit specific to certain types of engines. Maybe it would be helpful to me to see some examples from different engines and how views would be represented in them. A few more questions: 1. what if the catalog is set up differently or with a different name, can these be overriden? 2. why are they required? 3. how are these used at run time. If I have a query `select * from baz` and the `default-catalog=foo` and `default-namespace=bar` are we doing string replacement to then execute `select * from foo.bar.baz` or is it assumed that the user has to run a `USE CATALOG foo;USE NAMESPACE bar` statement first? String replacement sounds iffy as it can't really be done w/o understanding the sql (which we don't want to do yet) -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
