Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ALTER MATERIALIZED VIEW SET PROPERTIES
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The connector does not support :ref:`ALTER MATERIALIZED VIEW SET PROPERTIES
<alter-materialized-view-set-properties>` statements.
2 changes: 2 additions & 0 deletions docs/src/main/sphinx/connector/hive.rst
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,8 @@ features:

Refer to :doc:`the migration guide </appendix/from-hive>` for practical advice on migrating from Hive to Trino.

.. include:: alter-mv-set-properties-unsupported.fragment

.. _hive-alter-table-execute:

ALTER TABLE EXECUTE
Expand Down
2 changes: 2 additions & 0 deletions docs/src/main/sphinx/connector/iceberg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 30 additions & 0 deletions docs/src/main/sphinx/sql/alter-materialized-view.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----------
Expand All @@ -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.
Comment thread
hashhar marked this conversation as resolved.
Outdated

Support for ``ALTER MATERIALIZED VIEW SET PROPERTIES`` varies between
connectors. Refer to the connector documentation for more details.

Examples
--------

Expand All @@ -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';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have some mechanism (a system table like system.metadata.table_properties?) to inspect available properties and their data types and default values?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not. We could look at adding something like that in the future.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


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
--------

Expand Down