<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Unable to add column comment in Materialized View (MV) in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/unable-to-add-column-comment-in-materialized-view-mv/m-p/71263#M34273</link>
    <description>&lt;P&gt;&lt;A href="https://community.databricks.com/t5/user/viewprofilepage/user-id/101997" target="_blank"&gt;@leungi&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;you've shared the python language reference. This is the&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://docs.databricks.com/en/sql/language-manual/sql-ref-syntax-ddl-create-materialized-view.html" target="_blank" rel="noopener nofollow noreferrer"&gt;SQL Reference&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;from where I've based my example.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 31 May 2024 16:02:07 GMT</pubDate>
    <dc:creator>raphaelblg</dc:creator>
    <dc:date>2024-05-31T16:02:07Z</dc:date>
    <item>
      <title>Unable to add column comment in Materialized View (MV)</title>
      <link>https://community.databricks.com/t5/data-engineering/unable-to-add-column-comment-in-materialized-view-mv/m-p/68771#M33745</link>
      <description>&lt;P&gt;The following &lt;A href="https://docs.databricks.com/en/sql/language-manual/sql-ref-syntax-ddl-create-materialized-view.html" target="_self"&gt;doc&lt;/A&gt; suggests the ability to add column comments during MV creation via the `column list` parameter.&lt;/P&gt;&lt;P&gt;Thus, the SQL code below is expected to generate a table where the columns `col_1` and `col_2` are commented; however, this is not the case.&lt;/P&gt;&lt;P&gt;Note that the underlying table for the MV, `my_streaming_table`, is a Streaming Table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;%sql
USE CATALOG my_catalog;

USE SCHEMA my_schema;

DROP MATERIALIZED VIEW IF EXISTS my_mv;

CREATE MATERIALIZED VIEW my_mv
  (col_1 COMMENT 'Column 1', col_2 COMMENT 'Column 2')
  COMMENT 'MV of a streaming table.'
AS (
  SELECT col_1 , col_2 FROM my_streaming_table
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2024 21:29:57 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unable-to-add-column-comment-in-materialized-view-mv/m-p/68771#M33745</guid>
      <dc:creator>leungi</dc:creator>
      <dc:date>2024-05-10T21:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to add column comment in Materialized View (MV)</title>
      <link>https://community.databricks.com/t5/data-engineering/unable-to-add-column-comment-in-materialized-view-mv/m-p/70181#M34030</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/101997"&gt;@leungi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I've reproduced the issue and it appears that specifying the data type of the column is necessary for the statement to work. Here's an example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;CREATE MATERIALIZED VIEW my_mv
 (col_1 STRING COMMENT 'Column 1', col_2 INT COMMENT 'Column 2')&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I will consult with Databricks engineering to determine if this is the expected behavior or if there is potential for enhancement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2024 00:31:32 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unable-to-add-column-comment-in-materialized-view-mv/m-p/70181#M34030</guid>
      <dc:creator>raphaelblg</dc:creator>
      <dc:date>2024-05-22T00:31:32Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to add column comment in Materialized View (MV)</title>
      <link>https://community.databricks.com/t5/data-engineering/unable-to-add-column-comment-in-materialized-view-mv/m-p/71261#M34271</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/97998"&gt;@raphaelblg&lt;/a&gt;&amp;nbsp;thanks for the reply.&lt;/P&gt;&lt;P&gt;I tried the suggested edits, but came up with the following error:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;[&lt;A class="" href="https://docs.microsoft.com/azure/databricks/error-messages/error-classes#dlt_view_schema_with_type_not_supported" target="_blank" rel="noopener noreferrer"&gt;DLT_VIEW_SCHEMA_WITH_TYPE_NOT_SUPPORTED&lt;/A&gt;] MATERIALIZED VIEW schemas with a specified type are supported only in a Delta Live Tables pipeline. SQLSTATE: 56038; line 1 pos 0&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;The&amp;nbsp;&lt;A href="https://docs.databricks.com/en/delta-live-tables/python-ref.html#import-the-dlt-python-module" target="_self"&gt;docs&lt;/A&gt;&amp;nbsp;for DLT to create materialized views doesn't indicate a way to add column comment as you noted.&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2024 15:34:48 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unable-to-add-column-comment-in-materialized-view-mv/m-p/71261#M34271</guid>
      <dc:creator>leungi</dc:creator>
      <dc:date>2024-05-31T15:34:48Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to add column comment in Materialized View (MV)</title>
      <link>https://community.databricks.com/t5/data-engineering/unable-to-add-column-comment-in-materialized-view-mv/m-p/71263#M34273</link>
      <description>&lt;P&gt;&lt;A href="https://community.databricks.com/t5/user/viewprofilepage/user-id/101997" target="_blank"&gt;@leungi&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;you've shared the python language reference. This is the&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://docs.databricks.com/en/sql/language-manual/sql-ref-syntax-ddl-create-materialized-view.html" target="_blank" rel="noopener nofollow noreferrer"&gt;SQL Reference&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;from where I've based my example.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2024 16:02:07 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unable-to-add-column-comment-in-materialized-view-mv/m-p/71263#M34273</guid>
      <dc:creator>raphaelblg</dc:creator>
      <dc:date>2024-05-31T16:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to add column comment in Materialized View (MV)</title>
      <link>https://community.databricks.com/t5/data-engineering/unable-to-add-column-comment-in-materialized-view-mv/m-p/71264#M34274</link>
      <description>&lt;P&gt;Noted.&lt;BR /&gt;&lt;BR /&gt;I tried the following in both SQL Editor and Notebook and got the same outcome:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;%sql
USE CATALOG my_catalog;

USE SCHEMA my_schema;

DROP MATERIALIZED VIEW IF EXISTS my_mv;

CREATE MATERIALIZED VIEW my_mv
  (col_1 STRING COMMENT 'Column 1', col_2 STRING COMMENT 'Column 2')
  COMMENT 'MV of a streaming table.'
AS (
  SELECT col_1 , col_2 FROM my_streaming_table
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2024 16:06:06 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unable-to-add-column-comment-in-materialized-view-mv/m-p/71264#M34274</guid>
      <dc:creator>leungi</dc:creator>
      <dc:date>2024-05-31T16:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to add column comment in Materialized View (MV)</title>
      <link>https://community.databricks.com/t5/data-engineering/unable-to-add-column-comment-in-materialized-view-mv/m-p/71265#M34275</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/101997"&gt;@leungi&lt;/a&gt;&amp;nbsp;that's because:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;"&lt;STRONG&gt;All materialized views are backed by a DLT pipeline.&lt;/STRONG&gt; You can refresh materialized views manually, on a schedule, or by scheduling the DLT pipeline in which they’re contained." &lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;At&amp;nbsp;&lt;A href="https://docs.databricks.com/en/sql/language-manual/sql-ref-syntax-ddl-create-materialized-view.html" target="_blank"&gt;https://docs.databricks.com/en/sql/language-manual/sql-ref-syntax-ddl-create-materialized-view.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;In order to create Materialized Views, you need to use &lt;A href="https://docs.databricks.com/en/delta-live-tables/index.html" target="_self"&gt;Delta Live Tables&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2024 16:09:01 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unable-to-add-column-comment-in-materialized-view-mv/m-p/71265#M34275</guid>
      <dc:creator>raphaelblg</dc:creator>
      <dc:date>2024-05-31T16:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to add column comment in Materialized View (MV)</title>
      <link>https://community.databricks.com/t5/data-engineering/unable-to-add-column-comment-in-materialized-view-mv/m-p/71269#M34277</link>
      <description>&lt;P&gt;Managed to get it working per your guidance&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;&lt;P&gt;For future me:&lt;/P&gt;&lt;P&gt;1. Create a SQL notebook.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;CREATE OR REFRESH LIVE TABLE my_dlt_mv
(col_1 STRING COMMENT 'column_1', col_2 STRING COMMENT 'column_2')
COMMENT 'MV of a streaming table.'
AS (
  SELECT col_1 , col_2 FROM catalog.schema.streaming_table
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;2. Create a pipeline for the notebook.&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2024 16:41:30 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unable-to-add-column-comment-in-materialized-view-mv/m-p/71269#M34277</guid>
      <dc:creator>leungi</dc:creator>
      <dc:date>2024-05-31T16:41:30Z</dc:date>
    </item>
  </channel>
</rss>

