diff --git a/docs/src/main/sphinx/connector/iceberg.rst b/docs/src/main/sphinx/connector/iceberg.rst index 5e01a47a7efd..71091bbd4815 100644 --- a/docs/src/main/sphinx/connector/iceberg.rst +++ b/docs/src/main/sphinx/connector/iceberg.rst @@ -91,7 +91,8 @@ supports the following features: * :doc:`/sql/insert` * :doc:`/sql/delete`, see also :ref:`iceberg-delete` * :ref:`sql-schema-table-management`, see also :ref:`iceberg-tables` -* :ref:`sql-materialized-views-management` +* :ref:`sql-materialized-views-management`, see also + :ref:`iceberg-materialized-views` * :ref:`sql-views-management` .. _iceberg-tables: @@ -197,6 +198,8 @@ The connector supports queries of the table partitions. Given a table ``custome ``SELECT * FROM iceberg.testdb."customer_orders$partitions"`` shows the table partitions, including the minimum and maximum values for the partition columns. +.. _iceberg-table-properties: + Iceberg table properties ------------------------ @@ -226,3 +229,35 @@ and a file system location of ``/var/my_tables/test_table``:: format = 'PARQUET', partitioning = ARRAY['c1', 'c2'], location = '/var/my_tables/test_table') + +.. _iceberg-materialized-views: + +Materialized views +------------------ + +The Iceberg connector supports :ref:`sql-materialized-views-management`. In the +underlying system each materialized view consists of a view definition and an +Iceberg storage table. The storage table name is stored as a materialized view +property. The data is stored in that storage table. + +You can use the :ref:`iceberg-table-properties` to control the created storage +table and therefore the layout and performance. For example, you can use the +following clause with :doc:`/sql/create-materialized-view` to use the ORC format +for the data files and partition the storage per day using the column +``_date``:: + + WITH ( format = 'ORC', partitioning = ARRAY['event_date'] ) + +Updating the data in the materialized view with +:doc:`/sql/refresh-materialized-view` deletes the data from the storage table, +and inserts new data that is the result of executing the materialized view +query. + +.. warning:: + + There is a small time window between the commit of the delete and insert, + when the materialized view is empty. If the commit operation for the insert + fails, the materialized view remains empty. + +Dropping a materialized view with :doc:`/sql/refresh-materialized-view` removes +the definition and the storage table.