<?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: Issue with overwriting delta table in notebook to Atler warehouse table to Add column in Data Warehouse</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/Issue-with-overwriting-delta-table-in-notebook-to-Atler/m-p/3683535#M223</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As of now 6th Feb 2024 ,&lt;SPAN&gt;&amp;nbsp;ALTER TABLE command is not supported for tables in Lakehouse and Warehouse. So when you try to modify the table using Spark code it might result in some issues.&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please follow any of the two approaches listed below to alter column.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Drop the table and then add a column and then recreate the table.&lt;/LI&gt;&lt;LI&gt;Use CTAS statement to add new column. More on&amp;nbsp;&lt;A href="https://www.purplefrogsystems.com/2023/10/fabric-data-warehouse-alter-table-workaround/" target="_blank"&gt;https://www.purplefrogsystems.com/2023/10/fabric-data-warehouse-alter-table-workaround/&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Load data to a dataframe and then alter dataframe by appending/removing column. Then delete the table and recreate the table. More here&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/General-Discussion/Add-or-remove-column-in-Lakehouse-table/m-p/3604063#M3039" target="_blank"&gt;https://community.fabric.microsoft.com/t5/General-Discussion/Add-or-remove-column-in-Lakehouse-table/m-p/3604063#M3039&lt;/A&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kr,&lt;/P&gt;&lt;P&gt;Maddy&lt;/P&gt;</description>
    <pubDate>Tue, 06 Feb 2024 15:54:06 GMT</pubDate>
    <dc:creator>Madhusudan_P</dc:creator>
    <dc:date>2024-02-06T15:54:06Z</dc:date>
    <item>
      <title>Issue with overwriting delta table in notebook to Atler warehouse table to Add column</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/Issue-with-overwriting-delta-table-in-notebook-to-Atler/m-p/3683043#M222</link>
      <description>&lt;P&gt;I have been trying to alter a table in fabric warehouse to add a column but seems like there is a limitation to it. So I have been trying to implement this notebook by adding a column to the delta tables and save/orvewrite the existing file. I have used the below code to do so:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import os, requests&lt;BR /&gt;DATA_ROOT = "/lakehouse/default"&lt;BR /&gt;DATA_FOLDER = "Files/Test/dbo"&lt;BR /&gt;df_Dummy = spark.read.format('delta').option('header',True).option('inferSchema',True).load(f'{DATA_FOLDER}/Dummy/')&lt;BR /&gt;&lt;BR /&gt;spark.conf.set("spark.databricks.delta.schema.autoMerge.enabled",'true')&lt;BR /&gt;addingcol = df_Dummy.withColumn('DummyName', lit('Company'))&lt;BR /&gt;addingcol.write.format('delta').option('mergeSchema','true').mode('overwrite').save("Files/Test/dbo/Dummy")&lt;BR /&gt;addingcol.show()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But it has been throwing the following error:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I doing wrong here? Is it even possible to overwrite the exisiting table in delta format to add a column so it reflects in warehouse? The idea is to alter the table in warehouse to add a new column ultimately.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please do suggest any other way if anybody knows.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2024 16:37:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/Issue-with-overwriting-delta-table-in-notebook-to-Atler/m-p/3683043#M222</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-07T16:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with overwriting delta table in notebook to Atler warehouse table to Add column</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/Issue-with-overwriting-delta-table-in-notebook-to-Atler/m-p/3683535#M223</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As of now 6th Feb 2024 ,&lt;SPAN&gt;&amp;nbsp;ALTER TABLE command is not supported for tables in Lakehouse and Warehouse. So when you try to modify the table using Spark code it might result in some issues.&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please follow any of the two approaches listed below to alter column.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Drop the table and then add a column and then recreate the table.&lt;/LI&gt;&lt;LI&gt;Use CTAS statement to add new column. More on&amp;nbsp;&lt;A href="https://www.purplefrogsystems.com/2023/10/fabric-data-warehouse-alter-table-workaround/" target="_blank"&gt;https://www.purplefrogsystems.com/2023/10/fabric-data-warehouse-alter-table-workaround/&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Load data to a dataframe and then alter dataframe by appending/removing column. Then delete the table and recreate the table. More here&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/General-Discussion/Add-or-remove-column-in-Lakehouse-table/m-p/3604063#M3039" target="_blank"&gt;https://community.fabric.microsoft.com/t5/General-Discussion/Add-or-remove-column-in-Lakehouse-table/m-p/3604063#M3039&lt;/A&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kr,&lt;/P&gt;&lt;P&gt;Maddy&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2024 15:54:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/Issue-with-overwriting-delta-table-in-notebook-to-Atler/m-p/3683535#M223</guid>
      <dc:creator>Madhusudan_P</dc:creator>
      <dc:date>2024-02-06T15:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with overwriting delta table in notebook to Atler warehouse table to Add column</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/Issue-with-overwriting-delta-table-in-notebook-to-Atler/m-p/3688092#M224</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet .&lt;BR /&gt;In case if you have any resolution please do share that same with the community as it can be helpful to others . &lt;BR /&gt;Otherwise, will respond back with the more details and we will try to help .&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 10:58:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/Issue-with-overwriting-delta-table-in-notebook-to-Atler/m-p/3688092#M224</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-08T10:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with overwriting delta table in notebook to Atler warehouse table to Add column</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/Issue-with-overwriting-delta-table-in-notebook-to-Atler/m-p/3690361#M225</link>
      <description>&lt;P&gt;Hello&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet .&lt;BR /&gt;In case if you have any resolution please do share that same with the community as it can be helpful to others .&lt;BR /&gt;If you have any question relating to the current thread, please do let us know and we will try out best to help you.&lt;BR /&gt;In case if you have any other question on a different issue, we request you to open a new thread .&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 09:01:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/Issue-with-overwriting-delta-table-in-notebook-to-Atler/m-p/3690361#M225</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-09T09:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with overwriting delta table in notebook to Atler warehouse table to Add column</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/Issue-with-overwriting-delta-table-in-notebook-to-Atler/m-p/3914239#M226</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;The solutions that&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="678308" data-lia-user-login="Madhusudan_P" class="lia-mention lia-mention-user"&gt;Madhusudan_P&lt;/a&gt;&amp;nbsp; suggested involve deletion of the table as a step and I am looking for a solution where I could avoid that. I still have not found a solution for this. Waiting for Microsoft to fix this or get a better work aorund to alter the table to add column.&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2024 13:54:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/Issue-with-overwriting-delta-table-in-notebook-to-Atler/m-p/3914239#M226</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-05-13T13:54:40Z</dc:date>
    </item>
  </channel>
</rss>

