<?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: SQL View Formatting in Catalog - Can you turn it off? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/sql-view-formatting-in-catalog-can-you-turn-it-off/m-p/97791#M39550</link>
    <description>&lt;P&gt;I just confirmed with our internal teams that as of now there is no option to have this turned off. This will require a feature request to be submitted which you can do by following steps in&amp;nbsp;&lt;A href="https://docs.databricks.com/en/resources/ideas.html#create-an-idea-in-the-ideas-portal" target="_blank"&gt;https://docs.databricks.com/en/resources/ideas.html#create-an-idea-in-the-ideas-portal&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Nov 2024 16:16:16 GMT</pubDate>
    <dc:creator>Walter_C</dc:creator>
    <dc:date>2024-11-05T16:16:16Z</dc:date>
    <item>
      <title>SQL View Formatting in Catalog - Can you turn it off?</title>
      <link>https://community.databricks.com/t5/data-engineering/sql-view-formatting-in-catalog-can-you-turn-it-off/m-p/97647#M39519</link>
      <description>&lt;P&gt;It appears as though Databricks now formats SQL View definitions when showing them in the Catalog.&amp;nbsp; Our solution is based on views, and we have comment tags in those views.&amp;nbsp; We format these views so that it is easy for us to find and update parts of the view based on these tags.&amp;nbsp; When this generic formatting is applied, it breaks this process for us.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks like Databricks is storing the view correctly, as I get the view in the correct format when &lt;EM&gt;SHOW CREATE TABLE &amp;lt;view_name&amp;gt;&lt;/EM&gt; is returned.&amp;nbsp; But in Catalog, where we have trained people to get the view definition because you can easily copy it, the format is applied.&lt;/P&gt;&lt;P&gt;Has anyone found a way to turn this off?&lt;/P&gt;&lt;P&gt;Example - how it should be formatted:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SethParker_0-1730757882698.png" style="width: 337px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/12628i78DF38A9FEB50C20/image-dimensions/337x205?v=v2" width="337" height="205" role="button" title="SethParker_0-1730757882698.png" alt="SethParker_0-1730757882698.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What the generic formatted in Catalog does:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SethParker_1-1730757945105.png" style="width: 305px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/12629i37FAFB058EB9720B/image-dimensions/305x524?v=v2" width="305" height="524" role="button" title="SethParker_1-1730757945105.png" alt="SethParker_1-1730757945105.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2024 22:08:48 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/sql-view-formatting-in-catalog-can-you-turn-it-off/m-p/97647#M39519</guid>
      <dc:creator>SethParker</dc:creator>
      <dc:date>2024-11-04T22:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: SQL View Formatting in Catalog - Can you turn it off?</title>
      <link>https://community.databricks.com/t5/data-engineering/sql-view-formatting-in-catalog-can-you-turn-it-off/m-p/97649#M39520</link>
      <description>&lt;P&gt;Can you please provide me with the exact steps you are following to get this sample from the Catalog page?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2024 22:55:54 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/sql-view-formatting-in-catalog-can-you-turn-it-off/m-p/97649#M39520</guid>
      <dc:creator>Walter_C</dc:creator>
      <dc:date>2024-11-04T22:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: SQL View Formatting in Catalog - Can you turn it off?</title>
      <link>https://community.databricks.com/t5/data-engineering/sql-view-formatting-in-catalog-can-you-turn-it-off/m-p/97763#M39534</link>
      <description>&lt;P&gt;Hello Walter,&lt;/P&gt;&lt;P&gt;Thank you for your time.&amp;nbsp; In Databricks, I navigate to the Catalog tab, then to the view I want to look at.&amp;nbsp; Then on the Overview tab, in the Definition section we copy the view definition out.&amp;nbsp; This used to hold whatever format we used when we created the view.&amp;nbsp; Now, formatting has been applied to the front end.&lt;/P&gt;&lt;P&gt;We can get the unformatted view with SHOW CREATE TABLE, but that adds the list of fields at the top, which we do not want either.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example - how I created the view:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SethParker_0-1730816229641.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/12649i52F6A06D8357969F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SethParker_0-1730816229641.png" alt="SethParker_0-1730816229641.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How it is shown in Catalog:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SethParker_1-1730816243148.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/12650i61C31FC1C898E4DF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SethParker_1-1730816243148.png" alt="SethParker_1-1730816243148.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Seth&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 14:17:49 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/sql-view-formatting-in-catalog-can-you-turn-it-off/m-p/97763#M39534</guid>
      <dc:creator>SethParker</dc:creator>
      <dc:date>2024-11-05T14:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: SQL View Formatting in Catalog - Can you turn it off?</title>
      <link>https://community.databricks.com/t5/data-engineering/sql-view-formatting-in-catalog-can-you-turn-it-off/m-p/97768#M39538</link>
      <description>&lt;P&gt;Got it, I was able to reproduce the same internally, I will check with our teams to confirm if there is anything that can be done to change this behavior but seems to be expected.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 14:35:52 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/sql-view-formatting-in-catalog-can-you-turn-it-off/m-p/97768#M39538</guid>
      <dc:creator>Walter_C</dc:creator>
      <dc:date>2024-11-05T14:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: SQL View Formatting in Catalog - Can you turn it off?</title>
      <link>https://community.databricks.com/t5/data-engineering/sql-view-formatting-in-catalog-can-you-turn-it-off/m-p/97782#M39542</link>
      <description>&lt;P&gt;Thank you again for looking into it!&amp;nbsp; I agree that this is likely expected behavior.&amp;nbsp; I just wish there was a way to turn it off.&amp;nbsp; I love nearly everything about Databricks, but Views could use quite a bit of work.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 15:31:00 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/sql-view-formatting-in-catalog-can-you-turn-it-off/m-p/97782#M39542</guid>
      <dc:creator>SethParker</dc:creator>
      <dc:date>2024-11-05T15:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: SQL View Formatting in Catalog - Can you turn it off?</title>
      <link>https://community.databricks.com/t5/data-engineering/sql-view-formatting-in-catalog-can-you-turn-it-off/m-p/97791#M39550</link>
      <description>&lt;P&gt;I just confirmed with our internal teams that as of now there is no option to have this turned off. This will require a feature request to be submitted which you can do by following steps in&amp;nbsp;&lt;A href="https://docs.databricks.com/en/resources/ideas.html#create-an-idea-in-the-ideas-portal" target="_blank"&gt;https://docs.databricks.com/en/resources/ideas.html#create-an-idea-in-the-ideas-portal&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 16:16:16 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/sql-view-formatting-in-catalog-can-you-turn-it-off/m-p/97791#M39550</guid>
      <dc:creator>Walter_C</dc:creator>
      <dc:date>2024-11-05T16:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: SQL View Formatting in Catalog - Can you turn it off?</title>
      <link>https://community.databricks.com/t5/data-engineering/sql-view-formatting-in-catalog-can-you-turn-it-off/m-p/97990#M39578</link>
      <description>&lt;P&gt;Thank you!&amp;nbsp; I will submit that request.&lt;/P&gt;&lt;P&gt;In case anyone else stumbles upon this post, here is a function you can add that will return the view definition from information_schema, unformatted with an ALTER statement at the top:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DROP FUNCTION IF EXISTS &amp;lt;catalog&amp;gt;.&amp;lt;schema&amp;gt;.unformatedView;
CREATE OR REPLACE FUNCTION &amp;lt;catalog&amp;gt;.&amp;lt;schema&amp;gt;.unformatedView(catalogName STRING, schemaName STRING, viewName STRING)
  RETURNS TABLE(viewDef STRING)
  RETURN
    SELECT CONCAT("ALTER VIEW ", catalogName, ".", schemaName, ".", viewName, " AS 
", view_definition) as viewDef FROM system.information_schema.views 
    WHERE 
      table_catalog = catalogName and 
      table_schema = schemaName and 
      table_name = viewName;&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 06 Nov 2024 15:54:42 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/sql-view-formatting-in-catalog-can-you-turn-it-off/m-p/97990#M39578</guid>
      <dc:creator>SethParker</dc:creator>
      <dc:date>2024-11-06T15:54:42Z</dc:date>
    </item>
  </channel>
</rss>

