<?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 pyspark delta table schema evolution in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/pyspark-delta-table-schema-evolution/m-p/12773#M7535</link>
    <description>&lt;P&gt;I am using the schema evolution in the delta table and the code is written in databricks notebook.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; df.write
        .format("delta")
        .mode("append")
        .option("mergeSchema", "true")
        .partitionBy("date")
        .save(path)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I still got the error below. Is it correct to define the schema and enable the mergeSchema at the same time?&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;AnalysisException: The specified schema does not match the existing schema at path.
== Specified ==
&amp;nbsp;
    root
    -- A: string (nullable = false)
    -- B: string (nullable = true)
    -- C: long (nullable = true)
    
== Existing ==
    root
    -- A: string (nullable = true)
    -- B: string (nullable = true)
    -- C: long (nullable = true)
&amp;nbsp;
== Differences==
- Field A is non-nullable in specified schema but nullable in existing schema.
&amp;nbsp;
If your intention is to keep the existing schema, you can omit the
schema from the create table command. Otherwise please ensure that
the schema matches.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 22 Jul 2022 06:42:33 GMT</pubDate>
    <dc:creator>zyang</dc:creator>
    <dc:date>2022-07-22T06:42:33Z</dc:date>
    <item>
      <title>pyspark delta table schema evolution</title>
      <link>https://community.databricks.com/t5/data-engineering/pyspark-delta-table-schema-evolution/m-p/12773#M7535</link>
      <description>&lt;P&gt;I am using the schema evolution in the delta table and the code is written in databricks notebook.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; df.write
        .format("delta")
        .mode("append")
        .option("mergeSchema", "true")
        .partitionBy("date")
        .save(path)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I still got the error below. Is it correct to define the schema and enable the mergeSchema at the same time?&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;AnalysisException: The specified schema does not match the existing schema at path.
== Specified ==
&amp;nbsp;
    root
    -- A: string (nullable = false)
    -- B: string (nullable = true)
    -- C: long (nullable = true)
    
== Existing ==
    root
    -- A: string (nullable = true)
    -- B: string (nullable = true)
    -- C: long (nullable = true)
&amp;nbsp;
== Differences==
- Field A is non-nullable in specified schema but nullable in existing schema.
&amp;nbsp;
If your intention is to keep the existing schema, you can omit the
schema from the create table command. Otherwise please ensure that
the schema matches.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 06:42:33 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/pyspark-delta-table-schema-evolution/m-p/12773#M7535</guid>
      <dc:creator>zyang</dc:creator>
      <dc:date>2022-07-22T06:42:33Z</dc:date>
    </item>
    <item>
      <title>Re: pyspark delta table schema evolution</title>
      <link>https://community.databricks.com/t5/data-engineering/pyspark-delta-table-schema-evolution/m-p/12774#M7536</link>
      <description>&lt;P&gt;Hi @z yang​&amp;nbsp;Please provide the df creation code as well to understand the complete exception and scenario.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2022 21:04:11 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/pyspark-delta-table-schema-evolution/m-p/12774#M7536</guid>
      <dc:creator>Noopur_Nigam</dc:creator>
      <dc:date>2022-08-30T21:04:11Z</dc:date>
    </item>
  </channel>
</rss>

