<?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: Ownership change for table using SQL in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/ownership-change-for-table-using-sql/m-p/89180#M37717</link>
    <description>&lt;P&gt;ALTER TABLE catalogue.schema.table OWNER TO GUID&lt;/P&gt;&lt;P&gt;the rror is [PARSE_SYNTAX_ERROR] Syntax error at or near 'OWNER'.(line 1, pos 43)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Sep 2024 12:32:09 GMT</pubDate>
    <dc:creator>Nid-cbs</dc:creator>
    <dc:date>2024-09-09T12:32:09Z</dc:date>
    <item>
      <title>Ownership change for table using SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/ownership-change-for-table-using-sql/m-p/89163#M37711</link>
      <description>&lt;P&gt;It's not possible to use the ALTER TABLE tblname OWNER TO serviceprinc1 command in Azure Databricks, as this isn't supported. I was trying to set a catalog table's ownership, but it resulted in an error. How can I achieve this using a script&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2024 10:45:28 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/ownership-change-for-table-using-sql/m-p/89163#M37711</guid>
      <dc:creator>Nid-cbs</dc:creator>
      <dc:date>2024-09-09T10:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: Ownership change for table using SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/ownership-change-for-table-using-sql/m-p/89168#M37712</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/119882"&gt;@Nid-cbs&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Are you sure that you're using correct syntax? According to documentation it should be:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;ALTER TABLE table_name SET OWNER TO principal&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 09 Sep 2024 11:08:25 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/ownership-change-for-table-using-sql/m-p/89168#M37712</guid>
      <dc:creator>szymon_dybczak</dc:creator>
      <dc:date>2024-09-09T11:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: Ownership change for table using SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/ownership-change-for-table-using-sql/m-p/89180#M37717</link>
      <description>&lt;P&gt;ALTER TABLE catalogue.schema.table OWNER TO GUID&lt;/P&gt;&lt;P&gt;the rror is [PARSE_SYNTAX_ERROR] Syntax error at or near 'OWNER'.(line 1, pos 43)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2024 12:32:09 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/ownership-change-for-table-using-sql/m-p/89180#M37717</guid>
      <dc:creator>Nid-cbs</dc:creator>
      <dc:date>2024-09-09T12:32:09Z</dc:date>
    </item>
    <item>
      <title>Re: Ownership change for table using SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/ownership-change-for-table-using-sql/m-p/89181#M37718</link>
      <description>&lt;P&gt;I still think that you're using bad synxtax. You're missing SET keyword before OWNER. Try as below:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ALTER TABLE catalogue.schema.table SET OWNER TO GUID&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2024 12:38:26 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/ownership-change-for-table-using-sql/m-p/89181#M37718</guid>
      <dc:creator>szymon_dybczak</dc:creator>
      <dc:date>2024-09-09T12:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: Ownership change for table using SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/ownership-change-for-table-using-sql/m-p/89182#M37719</link>
      <description>&lt;P&gt;Thanks. Still the same error&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[PARSE_SYNTAX_ERROR] Syntax error at or near 'OWNER'.(line 1, pos 35) &lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2024 12:47:17 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/ownership-change-for-table-using-sql/m-p/89182#M37719</guid>
      <dc:creator>Nid-cbs</dc:creator>
      <dc:date>2024-09-09T12:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Ownership change for table using SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/ownership-change-for-table-using-sql/m-p/89189#M37722</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/119882"&gt;@Nid-cbs&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;It depends on how you are using the code.&lt;BR /&gt;Make sure you are using .sql notebook type or %sql magic command, and not spark.sql.&lt;BR /&gt;Also, the owner should be wrapped in ` &lt;SPAN&gt;backtick&amp;nbsp;&lt;/SPAN&gt;characters:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;%sql
ALTER TABLE test_table SET OWNER TO `owner`&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;More on that:&lt;BR /&gt;&lt;A href="https://stackoverflow.com/questions/68804903/databricks-alter-table-owner-to-userid-is-not-working-with-spark-sql-in-pysp" target="_blank" rel="noopener"&gt;https://stackoverflow.com/questions/68804903/databricks-alter-table-owner-to-userid-is-not-working-with-spark-sql-in-pysp&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2024 13:57:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/ownership-change-for-table-using-sql/m-p/89189#M37722</guid>
      <dc:creator>filipniziol</dc:creator>
      <dc:date>2024-09-09T13:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: Ownership change for table using SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/ownership-change-for-table-using-sql/m-p/89205#M37728</link>
      <description>&lt;P&gt;it turns out that&amp;nbsp;&lt;SPAN&gt;The ALTER TABLE statement in Databricks SQL does not support changing the owner of a table directly.It seems we need to use REST API to do the same&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2024 16:19:27 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/ownership-change-for-table-using-sql/m-p/89205#M37728</guid>
      <dc:creator>Nid-cbs</dc:creator>
      <dc:date>2024-09-09T16:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: Ownership change for table using SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/ownership-change-for-table-using-sql/m-p/89207#M37729</link>
      <description>&lt;P&gt;Thanks for the information. This is very strange though. I'll check it tommorrow. It should work in a notebook with %sql cell.&lt;/P&gt;&lt;P&gt;It won't work if use spark.sql("ALTER TABLE test_table SET OWNER TO `owner_name`") though.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2024 16:51:17 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/ownership-change-for-table-using-sql/m-p/89207#M37729</guid>
      <dc:creator>szymon_dybczak</dc:creator>
      <dc:date>2024-09-09T16:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: Ownership change for table using SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/ownership-change-for-table-using-sql/m-p/98583#M39745</link>
      <description>&lt;P&gt;I was getting same error in python notebook and I found typo in my sql:&lt;/P&gt;&lt;P&gt;Changing from&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;ALTER TABLE table_name SET OWNER TO 'principal'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to below fixed the issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;ALTER TABLE table_name SET OWNER TO `principal`&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;</description>
      <pubDate>Tue, 12 Nov 2024 21:16:07 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/ownership-change-for-table-using-sql/m-p/98583#M39745</guid>
      <dc:creator>vjani</dc:creator>
      <dc:date>2024-11-12T21:16:07Z</dc:date>
    </item>
  </channel>
</rss>

