From 09a1234ad15f2f3bab466641026625e7b7164afc Mon Sep 17 00:00:00 2001 From: Joe Lodin Date: Thu, 27 Jan 2022 17:42:58 -0500 Subject: [PATCH] Document ALTER MATERIALIZED VIEW SET PROPERTIES --- ...ter-mv-set-properties-unsupported.fragment | 5 ++++ docs/src/main/sphinx/connector/hive.rst | 2 ++ docs/src/main/sphinx/connector/iceberg.rst | 2 ++ .../sphinx/sql/alter-materialized-view.rst | 30 +++++++++++++++++++ 4 files changed, 39 insertions(+) create mode 100644 docs/src/main/sphinx/connector/alter-mv-set-properties-unsupported.fragment diff --git a/docs/src/main/sphinx/connector/alter-mv-set-properties-unsupported.fragment b/docs/src/main/sphinx/connector/alter-mv-set-properties-unsupported.fragment new file mode 100644 index 000000000000..bf5c5f88ddfe --- /dev/null +++ b/docs/src/main/sphinx/connector/alter-mv-set-properties-unsupported.fragment @@ -0,0 +1,5 @@ +ALTER MATERIALIZED VIEW SET PROPERTIES +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The connector does not support :ref:`ALTER MATERIALIZED VIEW SET PROPERTIES +` statements. diff --git a/docs/src/main/sphinx/connector/hive.rst b/docs/src/main/sphinx/connector/hive.rst index b020ac8f9d3c..32f46f152745 100644 --- a/docs/src/main/sphinx/connector/hive.rst +++ b/docs/src/main/sphinx/connector/hive.rst @@ -680,6 +680,8 @@ features: Refer to :doc:`the migration guide ` for practical advice on migrating from Hive to Trino. +.. include:: alter-mv-set-properties-unsupported.fragment + .. _hive-alter-table-execute: ALTER TABLE EXECUTE diff --git a/docs/src/main/sphinx/connector/iceberg.rst b/docs/src/main/sphinx/connector/iceberg.rst index 4a259828a88d..97c0bc848769 100644 --- a/docs/src/main/sphinx/connector/iceberg.rst +++ b/docs/src/main/sphinx/connector/iceberg.rst @@ -127,6 +127,8 @@ supports the following features: :ref:`iceberg-materialized-views` * :ref:`sql-views-management` +.. include:: alter-mv-set-properties-unsupported.fragment + .. _iceberg-type-mapping: Type mapping diff --git a/docs/src/main/sphinx/sql/alter-materialized-view.rst b/docs/src/main/sphinx/sql/alter-materialized-view.rst index 263bb0e42ef0..1754c7cffad6 100644 --- a/docs/src/main/sphinx/sql/alter-materialized-view.rst +++ b/docs/src/main/sphinx/sql/alter-materialized-view.rst @@ -8,6 +8,7 @@ Synopsis .. code-block:: text ALTER MATERIALIZED VIEW [ IF EXISTS ] name RENAME TO new_name + ALTER MATERIALIZED VIEW name SET PROPERTIES property_name = expression [, ...] Description ----------- @@ -19,6 +20,22 @@ materialized view does not exist. The error is not suppressed if the materialized view does not exist, but a table or view with the given name exists. +.. _alter-materialized-view-set-properties: + +SET PROPERTIES +^^^^^^^^^^^^^^ + +The ``ALTER MATERALIZED VIEW SET PROPERTIES`` statement followed by some number +of ``property_name`` and ``expression`` pairs applies the specified properties +and values to a materialized view. Ommitting an already-set property from this +statement leaves that property unchanged in the materialized view. + +A property in a ``SET PROPERTIES`` statement can be set to ``DEFAULT``, which +reverts its value back to the default in that materialized view. + +Support for ``ALTER MATERIALIZED VIEW SET PROPERTIES`` varies between +connectors. Refer to the connector documentation for more details. + Examples -------- @@ -31,6 +48,19 @@ Rename materialized view ``people`` to ``users``, if materialized view ALTER MATERIALIZED VIEW IF EXISTS people RENAME TO users; +Set view properties (``x = y``) in materialized view ``people``:: + + ALTER MATERIALIZED VIEW people SET PROPERTIES x = 'y'; + +Set multiple view properties (``foo = 123`` and ``foo bar = 456``) in +materialized view ``people``:: + + ALTER MATERALIZED VIEW people SET PROPERTIES foo = 123, "foo bar" = 456; + +Set view property ``x`` to its default value in materialized view ``people``:: + + ALTER MATERALIZED VIEW people SET PROPERTIES x = DEFAULT; + See also --------