<?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: how to remove column from delta table? in Data Engineering</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Engineering/how-to-remove-column-from-delta-table/m-p/3707406#M367</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/593472"&gt;@jonjoseph&lt;/a&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>Mon, 19 Feb 2024 09:02:34 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-02-19T09:02:34Z</dc:date>
    <item>
      <title>how to remove column from delta table?</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/how-to-remove-column-from-delta-table/m-p/3696908#M362</link>
      <description>&lt;P&gt;I managed to add new columns to an existing table using&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    df.limit(0).write.format("delta").mode("append").option("mergeSchema", "true").save(tablename)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;however when columns are removed , this method does not actually drop columns in the delta table. I think I read that it doesnt actually remove the column, but will set the value to null?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;however when I then run the merge, it fails with&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;AnalysisException&lt;SPAN&gt;: Cannot resolve &amp;lt;removed column&amp;gt; in UPDATE clause given columns .....&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    delta_table.alias("target").merge(
        source=df.alias("source"),
        condition="target.accessnum = source.accessnum",  
    ).whenMatchedUpdateAll().whenNotMatchedInsertAll().execute()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so this seems to me that it doesnt know that the source column has been removed.&lt;/P&gt;&lt;P&gt;I have the configuration set with&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;spark.conf.set("spark.sql.parquet.vorder.enabled", "true")
spark.conf.set("spark.microsoft.delta.optimizeWrite.enabled", "true")
spark.conf.set("spark.microsoft.delta.optimizeWrite.binSize", "1073741824")

spark.conf.set("spark.microsoft.delta.schema.autoMerge.enabled", "true")

#config to enable all new Delta tables with Change Data Feed
spark.conf.set("spark.microsoft.delta.properties.defaults.enableChangeDataFeed", "true")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so what do I have to do to handle columns being removed from the source when updating and inserting?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2024 16:33:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/how-to-remove-column-from-delta-table/m-p/3696908#M362</guid>
      <dc:creator>jonjoseph</dc:creator>
      <dc:date>2024-02-13T16:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove column from delta table?</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/how-to-remove-column-from-delta-table/m-p/3698776#M363</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/593472"&gt;@jonjoseph&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Thanks for using Fabric Community.&lt;BR /&gt;As I understand you are trying to&lt;SPAN&gt;&amp;nbsp;insert a column into the target table that does not exist in the source table.&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I haven't tried it, but you can refer this -&amp;nbsp;&lt;A href="https://techcommunity.microsoft.com/t5/azure-synapse-analytics/merge-on-delta-table-with-source-structure-change/m-p/3872001" target="_blank"&gt;MERGE on delta table with source structure change - Microsoft Community Hub&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;Incase if my understanding is wrong, can you please share few more details so that I can guide you better.&lt;BR /&gt;&lt;BR /&gt;Hope this is helpful. Please let me know incase of further queries.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2024 12:32:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/how-to-remove-column-from-delta-table/m-p/3698776#M363</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-14T12:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove column from delta table?</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/how-to-remove-column-from-delta-table/m-p/3698851#M364</link>
      <description>&lt;P&gt;The source has removed the column, and I am doing a merge and update all the delta table. However updateall is trying to update the column that no longer exists in the source.&lt;/P&gt;&lt;P&gt;It beginning to sound like I will have to specify the columns and can't just use updateall.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2024 13:21:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/how-to-remove-column-from-delta-table/m-p/3698851#M364</guid>
      <dc:creator>jonjoseph</dc:creator>
      <dc:date>2024-02-14T13:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove column from delta table?</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/how-to-remove-column-from-delta-table/m-p/3701143#M365</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/593472"&gt;@jonjoseph&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Is this helpful -&amp;nbsp;&lt;A href="https://techcommunity.microsoft.com/t5/azure-synapse-analytics/merge-on-delta-table-with-source-structure-change/m-p/3872001" target="_blank"&gt;MERGE on delta table with source structure change - Microsoft Community Hub&lt;/A&gt;&lt;BR /&gt;It is also having a discussion on this point too -&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vgchennamsft_0-1707997492967.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1043287i9E4179814D85CFBE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vgchennamsft_0-1707997492967.png" alt="vgchennamsft_0-1707997492967.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2024 11:45:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/how-to-remove-column-from-delta-table/m-p/3701143#M365</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-15T11:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove column from delta table?</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/how-to-remove-column-from-delta-table/m-p/3704276#M366</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/593472"&gt;@jonjoseph&lt;/a&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 more details and we will try to help .&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2024 14:51:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/how-to-remove-column-from-delta-table/m-p/3704276#M366</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-16T14:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove column from delta table?</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/how-to-remove-column-from-delta-table/m-p/3707406#M367</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/593472"&gt;@jonjoseph&lt;/a&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>Mon, 19 Feb 2024 09:02:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/how-to-remove-column-from-delta-table/m-p/3707406#M367</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-19T09:02:34Z</dc:date>
    </item>
  </channel>
</rss>

