<?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: Error writing table to Warehouse from notebook in Data Engineering</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Error-writing-table-to-Warehouse-from-notebook/m-p/5130943#M15426</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1351446"&gt;@reubtfp&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Overwrite will only overwrite table data, not the schema. If you want to overwrite schema, then use option("overwriteSchema", "True") while writing to table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Srisakthi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 12 Mar 2026 13:41:28 GMT</pubDate>
    <dc:creator>Srisakthi</dc:creator>
    <dc:date>2026-03-12T13:41:28Z</dc:date>
    <item>
      <title>Error writing table to Warehouse from notebook</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Error-writing-table-to-Warehouse-from-notebook/m-p/5130934#M15425</link>
      <description>&lt;P&gt;Using the following function&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def copy_table(source_table: str, dest_table: str):
    """Read from lakehouse and write to TARGET_DB, replacing existing table."""

    full_source = f"{SOURCE_DB}.{SOURCE_SCHEMA}.{source_table}"
    df = spark.read.table(full_source)

    full_dest = f"{TARGET_DB}.{DEST_SCHEMA}.{dest_table}"

    if df.count() &amp;gt; 0:
        df.write.mode("overwrite").synapsesql(full_dest)
        print(f"Copied {source_table} -&amp;gt; {dest_table}")

    else:
        print(f"Table {source_table} is empty, skipping copy!")&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;We were receiving multiple "Schemas are not equal" errors.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;com.microsoft.spark.fabric.tds.write.error.FabricSparkTDSWriteError: Schemas are not equal (ignoring metadata):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error is correct in that the schemas are not equal, but the .synapsesql function was being invoked in overwrite mode, so the schema mismatch shouldn't error.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2026 13:36:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Error-writing-table-to-Warehouse-from-notebook/m-p/5130934#M15425</guid>
      <dc:creator>reubtfp</dc:creator>
      <dc:date>2026-03-12T13:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: Error writing table to Warehouse from notebook</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Error-writing-table-to-Warehouse-from-notebook/m-p/5130943#M15426</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1351446"&gt;@reubtfp&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Overwrite will only overwrite table data, not the schema. If you want to overwrite schema, then use option("overwriteSchema", "True") while writing to table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Srisakthi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2026 13:41:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Error-writing-table-to-Warehouse-from-notebook/m-p/5130943#M15426</guid>
      <dc:creator>Srisakthi</dc:creator>
      <dc:date>2026-03-12T13:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: Error writing table to Warehouse from notebook</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Error-writing-table-to-Warehouse-from-notebook/m-p/5130945#M15427</link>
      <description>&lt;P&gt;Thought I'd post that the root cause for this is because we have only recently updated the workspace default Fabric runtime in the environment from 1.2 to 1.3, so clearly some incompatability in the delta table format meant that the overwrite was failing.&lt;BR /&gt;&lt;BR /&gt;Other tables which were also previously built using runtime 1.2 (spark 3.4, delta 2.4)... but which did not have a schema difference... did not experience the issue.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;The solution was to drop or recreate the table outside the notebook - following which, the .synapsesql call works correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2026 13:42:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Error-writing-table-to-Warehouse-from-notebook/m-p/5130945#M15427</guid>
      <dc:creator>reubtfp</dc:creator>
      <dc:date>2026-03-12T13:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: Error writing table to Warehouse from notebook</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Error-writing-table-to-Warehouse-from-notebook/m-p/5130948#M15428</link>
      <description>&lt;P&gt;No, I tried this also and got the same error.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2026 13:43:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Error-writing-table-to-Warehouse-from-notebook/m-p/5130948#M15428</guid>
      <dc:creator>reubtfp</dc:creator>
      <dc:date>2026-03-12T13:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: Error writing table to Warehouse from notebook</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Error-writing-table-to-Warehouse-from-notebook/m-p/5130950#M15429</link>
      <description>&lt;P&gt;... but I'm also not sure that option is supported for the synapsesql connector. It's not in the documentation at least.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2026 13:44:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Error-writing-table-to-Warehouse-from-notebook/m-p/5130950#M15429</guid>
      <dc:creator>reubtfp</dc:creator>
      <dc:date>2026-03-12T13:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: Error writing table to Warehouse from notebook</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Error-writing-table-to-Warehouse-from-notebook/m-p/5134067#M15490</link>
      <description>&lt;P&gt;Actually, this still doesn't work. I think it's a bug.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;both of;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;df.write.&lt;/SPAN&gt;&lt;SPAN&gt;mode(&lt;/SPAN&gt;&lt;SPAN&gt;"overwrite"&lt;/SPAN&gt;&lt;SPAN&gt;).synapsesql(full_dest)&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;and;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;df.write.option(&lt;/SPAN&gt;&lt;SPAN&gt;'overwriteSchema'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'true'&lt;/SPAN&gt;&lt;SPAN&gt;).mode(&lt;/SPAN&gt;&lt;SPAN&gt;"overwrite"&lt;/SPAN&gt;&lt;SPAN&gt;).synapsesql(full_dest)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;have failed. Runtime 1.3 was not the solution.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 17 Mar 2026 11:11:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Error-writing-table-to-Warehouse-from-notebook/m-p/5134067#M15490</guid>
      <dc:creator>reubtfp</dc:creator>
      <dc:date>2026-03-17T11:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: Error writing table to Warehouse from notebook</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Error-writing-table-to-Warehouse-from-notebook/m-p/5134392#M15497</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1351446"&gt;@reubtfp&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The behavior you're seeing is expected with the current .synapsesql() connector. Even if you use mode("overwrite"), it only replaces the data in the target Warehouse table and doesn't support schema overwrite or evolution. The option("overwriteSchema","true") parameter isn't supported with .synapsesql(), which is why you get the &lt;I&gt;“Schemas are not equal”&lt;/I&gt; error in both cases.&lt;/P&gt;
&lt;P&gt;With this connector, the source DataFrame schema must match the target Warehouse table schema exactly—any differences in columns, data types, order, or nullability will cause the write to fail, regardless of the overwrite mode. This is a known connector limitation and isn't related to the runtime version.&lt;/P&gt;
&lt;P&gt;To resolve the issue, make sure your DataFrame schema matches the target table before writing. If you expect schema changes, you'll need to drop and recreate the target table before writing. Alternatively, you can write to a Lakehouse (Delta table) first, where schema overwrite is supported, and then load the data into the Warehouse after aligning the schema.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2026 04:46:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Error-writing-table-to-Warehouse-from-notebook/m-p/5134392#M15497</guid>
      <dc:creator>v-sgandrathi</dc:creator>
      <dc:date>2026-03-18T04:46:12Z</dc:date>
    </item>
  </channel>
</rss>

