<?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 Handling New Columns Using Auto Loader Rescue Mode but how will get newly added column in Databricks Free Edition Help</title>
    <link>https://community.databricks.com/t5/databricks-free-edition-help/handling-new-columns-using-auto-loader-rescue-mode-but-how-will/m-p/155232#M757</link>
    <description>&lt;P&gt;Schema evolution (rescue mode) is being triggered for a complex JSON file. However, when a new column is added in the source, it does not appear in the target table automatically for multi-level nested JSON. How can we add newly added nested columns to the target table when using Databricks Auto Loader with rescue mode?&lt;/P&gt;</description>
    <pubDate>Wed, 22 Apr 2026 18:54:12 GMT</pubDate>
    <dc:creator>SantiNath_Dey</dc:creator>
    <dc:date>2026-04-22T18:54:12Z</dc:date>
    <item>
      <title>Handling New Columns Using Auto Loader Rescue Mode but how will get newly added column</title>
      <link>https://community.databricks.com/t5/databricks-free-edition-help/handling-new-columns-using-auto-loader-rescue-mode-but-how-will/m-p/155232#M757</link>
      <description>&lt;P&gt;Schema evolution (rescue mode) is being triggered for a complex JSON file. However, when a new column is added in the source, it does not appear in the target table automatically for multi-level nested JSON. How can we add newly added nested columns to the target table when using Databricks Auto Loader with rescue mode?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2026 18:54:12 GMT</pubDate>
      <guid>https://community.databricks.com/t5/databricks-free-edition-help/handling-new-columns-using-auto-loader-rescue-mode-but-how-will/m-p/155232#M757</guid>
      <dc:creator>SantiNath_Dey</dc:creator>
      <dc:date>2026-04-22T18:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: Handling New Columns Using Auto Loader Rescue Mode but how will get newly added column</title>
      <link>https://community.databricks.com/t5/databricks-free-edition-help/handling-new-columns-using-auto-loader-rescue-mode-but-how-will/m-p/155239#M758</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/219024"&gt;@SantiNath_Dey&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;In rescue mode, Auto Loader intentionally freezes the schema. This is by design. New columns, whether top-level or nested, will not appear in the target, they land in _rescued_data as a JSON string. That is the mode's contract.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Refer to this &lt;A href="https://docs.databricks.com/aws/en/ingestion/cloud-object-storage/auto-loader/schema#how-does-auto-loader-schema-evolution-work" target="_blank"&gt;page&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ashwin_DSA_0-1776888090816.png" style="width: 999px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/26314iBD135C8A8FD1A816/image-size/large?v=v2&amp;amp;px=999" role="button" title="Ashwin_DSA_0-1776888090816.png" alt="Ashwin_DSA_0-1776888090816.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You'll have to switch the evolution mode to resolve this...&lt;/P&gt;
&lt;P&gt;While you can consider other options like&amp;nbsp;pre-declaring the fields you need using something like &lt;A href="https://docs.databricks.com/aws/en/ingestion/cloud-object-storage/auto-loader/schema#override-schema-inference-with-schema-hints" target="_blank"&gt;schemahints&lt;/A&gt;, this only works when you know which fields you are sure about. It's not something you'd want to use for complex json structures.&amp;nbsp;Rescue mode is best thought of as a safety net for unexpected data, not as an evolution strategy.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a specific reason why you'd want to do that?&lt;/P&gt;
&lt;P class="p1"&gt;&lt;FONT size="2" color="#FF6600"&gt;&lt;STRONG&gt;&lt;I&gt;If this answer resolves your question, could you mark it as “Accept as Solution”? That helps other users quickly find the correct fix.&lt;/I&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;I&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2026 20:10:54 GMT</pubDate>
      <guid>https://community.databricks.com/t5/databricks-free-edition-help/handling-new-columns-using-auto-loader-rescue-mode-but-how-will/m-p/155239#M758</guid>
      <dc:creator>Ashwin_DSA</dc:creator>
      <dc:date>2026-04-22T20:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: Handling New Columns Using Auto Loader Rescue Mode but how will get newly added column</title>
      <link>https://community.databricks.com/t5/databricks-free-edition-help/handling-new-columns-using-auto-loader-rescue-mode-but-how-will/m-p/155285#M759</link>
      <description>&lt;P&gt;Hi Ashwin, Thanks for quick response .&amp;nbsp;Could you please share sample code to handle new column additions and data type changes for multi-level nested JSON files?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2026 08:04:29 GMT</pubDate>
      <guid>https://community.databricks.com/t5/databricks-free-edition-help/handling-new-columns-using-auto-loader-rescue-mode-but-how-will/m-p/155285#M759</guid>
      <dc:creator>SantiNath_Dey</dc:creator>
      <dc:date>2026-04-23T08:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: Handling New Columns Using Auto Loader Rescue Mode but how will get newly added column</title>
      <link>https://community.databricks.com/t5/databricks-free-edition-help/handling-new-columns-using-auto-loader-rescue-mode-but-how-will/m-p/155370#M760</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/219024"&gt;@SantiNath_Dey&lt;/a&gt;,&lt;/P&gt;
&lt;P class="p8i6j01 paragraph"&gt;There are two ways you can do it. The pattern below should work.&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;source_path     = "s3://your-bucket/raw/json"
schema_location = "s3://your-bucket/_schemas/my_stream"
checkpoint_path = "s3://your-bucket/_checkpoints/my_stream"
target_table    = "catalog.db.nested_events"

df = (spark.readStream
        .format("cloudFiles")
        .option("cloudFiles.format", "json")
        .option("cloudFiles.schemaLocation", schema_location)
        .option("cloudFiles.schemaEvolutionMode", "addNewColumns")  
        .option("cloudFiles.inferColumnTypes", "true")              # infer nested structure
        .option("rescuedDataColumn", "_rescued_data")               # capture mismatches/new unexpected fields
        .load(source_path)
)

(df.writeStream
   .format("delta")
   .option("checkpointLocation", checkpoint_path)
   .option("mergeSchema", "true")   # apply evolved schema (incl. nested) to Delta table
   .toTable(target_table))&lt;/LI-CODE&gt;
&lt;P&gt;The above uses&amp;nbsp; &lt;FONT color="#993300"&gt;.option("cloudFiles.schemaEvolutionMode", "addNewColumns")&lt;/FONT&gt;. With this option, when a new column appears, stream fails with UnknownFieldException, Auto Loader infers the updated schema (including the new column), writes it to schemaLocation, and you restart the stream. On restart you must use mergeSchema so the Delta table picks up the new column. However, when a column’s data type changes (e.g. INT → LONG)...the schema is not evolved. Mismatched values are set to NULL and the original values go into _rescued_data.&lt;/P&gt;
&lt;P&gt;A modified pattern is... instead of using &lt;FONT color="#993300"&gt;.option("cloudFiles.schemaEvolutionMode", "addNewColumns")&lt;/FONT&gt;, use&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;.option("cloudFiles.schemaEvolutionMode", "addNewColumnsWithTypeWidening")&lt;/LI-CODE&gt;
&lt;P&gt;The difference is that this mode can deal with both new columns and type changes. For new columns, it results in the same behaviour as addNewColumns (added to the schema when the stream restarts). In addition to that it also supports&amp;nbsp;widenable type changes (e.g. INT → LONG, FLOAT → DOUBLE, smaller → larger DECIMAL). Auto Loader automatically widens the column type in the schema instead of treating the new values as mismatches, so they land in the main column rather than _rescued_data. The caveat with this option is that this is in public preview and needs&amp;nbsp;DBR ≥ 16.4. So start with the&amp;nbsp;addNewColumns and move to&amp;nbsp;addNewColumnsWithTypeWidening at later time.&lt;/P&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;
&lt;P class="p1"&gt;&lt;FONT size="2" color="#FF6600"&gt;&lt;STRONG&gt;&lt;I&gt;If this answer resolves your question, could you mark it as “Accept as Solution”? That helps other users quickly find the correct fix.&lt;/I&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;I&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="l8rrz21 _1ibi0s3do" data-ui-element="code-block-container"&gt;
&lt;DIV class="l8rrz23 _1ibi0s3d7 _1ibi0s332 _1ibi0s3dp _1ibi0s3bm _1ibi0s3ce"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 23 Apr 2026 20:53:12 GMT</pubDate>
      <guid>https://community.databricks.com/t5/databricks-free-edition-help/handling-new-columns-using-auto-loader-rescue-mode-but-how-will/m-p/155370#M760</guid>
      <dc:creator>Ashwin_DSA</dc:creator>
      <dc:date>2026-04-23T20:53:12Z</dc:date>
    </item>
    <item>
      <title>Re: Handling New Columns Using Auto Loader Rescue Mode but how will get newly added column</title>
      <link>https://community.databricks.com/t5/databricks-free-edition-help/handling-new-columns-using-auto-loader-rescue-mode-but-how-will/m-p/155401#M763</link>
      <description>&lt;P&gt;Thank you quick response . I will check and get back you.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2026 03:57:40 GMT</pubDate>
      <guid>https://community.databricks.com/t5/databricks-free-edition-help/handling-new-columns-using-auto-loader-rescue-mode-but-how-will/m-p/155401#M763</guid>
      <dc:creator>SantiNath_Dey</dc:creator>
      <dc:date>2026-04-24T03:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: Handling New Columns Using Auto Loader Rescue Mode but how will get newly added column</title>
      <link>https://community.databricks.com/t5/databricks-free-edition-help/handling-new-columns-using-auto-loader-rescue-mode-but-how-will/m-p/155417#M764</link>
      <description>&lt;DIV&gt;The solution using the option &lt;STRONG&gt;.option("cloudFiles.schemaEvolutionMode", "addNewColumns")&lt;/STRONG&gt; is working as expected. With this configuration, when a new column appears in the source, the stream fails with an &lt;STRONG&gt;UnknownFieldException&lt;/STRONG&gt;. However, we would like to capture any newly added columns using the &lt;STRONG&gt;schema drift (rescue column)&lt;/STRONG&gt; mechanism. If this is not possible using the schema drift option, an alternative approach is required to &lt;STRONG&gt;print or log the names of the newly added columns&lt;/STRONG&gt; so that business users can be notified.&lt;/DIV&gt;</description>
      <pubDate>Fri, 24 Apr 2026 07:23:12 GMT</pubDate>
      <guid>https://community.databricks.com/t5/databricks-free-edition-help/handling-new-columns-using-auto-loader-rescue-mode-but-how-will/m-p/155417#M764</guid>
      <dc:creator>SantiNath_Dey</dc:creator>
      <dc:date>2026-04-24T07:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: Handling New Columns Using Auto Loader Rescue Mode but how will get newly added column</title>
      <link>https://community.databricks.com/t5/databricks-free-edition-help/handling-new-columns-using-auto-loader-rescue-mode-but-how-will/m-p/155433#M765</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/219024"&gt;@SantiNath_Dey&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;No... With cloudFiles.schemaEvolutionMode="addNewColumns", new columns are never put into the rescuedDataColumn. They always trigger an UnknownFieldException, Auto Loader writes an updated schema to schemaLocation, and then you restart the stream. There is no mode that both (a) evolves the schema and (b) rescues new columns instead of failing.&lt;/P&gt;
&lt;P&gt;So you need a separate detection/logging step. A simple approach is to let Auto Loader run with addNewColumns (as you do now).&amp;nbsp;After the schema has evolved and the table has been updated (after restart with mergeSchema), diff the table schema against a stored "previous schema snapshot"&amp;nbsp;and log any new paths.&lt;/P&gt;
&lt;P&gt;You can notify business users via email/alerts/dashboard, which can be built from the diff table created above.&amp;nbsp;However, there’s no supported combination where addNewColumns will both evolve the schema and also send those new fields into the rescue column if that's what you are expecting.&lt;/P&gt;
&lt;P class="p1"&gt;&lt;FONT size="2" color="#FF6600"&gt;&lt;STRONG&gt;&lt;I&gt;If this answer resolves your question, could you mark it as “Accept as Solution”? That helps other users quickly find the correct fix.&lt;/I&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;I&gt;&lt;/I&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2026 10:01:51 GMT</pubDate>
      <guid>https://community.databricks.com/t5/databricks-free-edition-help/handling-new-columns-using-auto-loader-rescue-mode-but-how-will/m-p/155433#M765</guid>
      <dc:creator>Ashwin_DSA</dc:creator>
      <dc:date>2026-04-24T10:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: Handling New Columns Using Auto Loader Rescue Mode but how will get newly added column</title>
      <link>https://community.databricks.com/t5/databricks-free-edition-help/handling-new-columns-using-auto-loader-rescue-mode-but-how-will/m-p/155463#M766</link>
      <description>&lt;DIV&gt;Thank you for your response. Do you have ant sample of schema comapre code beween old and New for complex and nested json file. That will be very helpful.&lt;/DIV&gt;</description>
      <pubDate>Fri, 24 Apr 2026 16:34:59 GMT</pubDate>
      <guid>https://community.databricks.com/t5/databricks-free-edition-help/handling-new-columns-using-auto-loader-rescue-mode-but-how-will/m-p/155463#M766</guid>
      <dc:creator>SantiNath_Dey</dc:creator>
      <dc:date>2026-04-24T16:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: Handling New Columns Using Auto Loader Rescue Mode but how will get newly added column</title>
      <link>https://community.databricks.com/t5/databricks-free-edition-help/handling-new-columns-using-auto-loader-rescue-mode-but-how-will/m-p/155470#M767</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/219024"&gt;@SantiNath_Dey&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I don't have sample code to share, but everything you need is in the ideas and docs already posted. Give it a go and see how far you get. If you hit a specific error or get stuck on a particular step, drop the code snippet and the error here, and I'll take a look.&lt;/P&gt;
&lt;P&gt;Writing the full implementation for scenarios like this is beyond what I can scope over this community forum, but I'm happy to unblock you once you've got something started. Curious to see what you come up with!&lt;/P&gt;
&lt;P&gt;Good luck!&lt;/P&gt;
&lt;P class="p1"&gt;&lt;FONT size="2" color="#FF6600"&gt;&lt;STRONG&gt;&lt;I&gt;If this answer resolves your question, could you mark it as “Accept as Solution”? That helps other users quickly find the correct fix.&lt;/I&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;I&gt;&lt;/I&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2026 21:24:18 GMT</pubDate>
      <guid>https://community.databricks.com/t5/databricks-free-edition-help/handling-new-columns-using-auto-loader-rescue-mode-but-how-will/m-p/155470#M767</guid>
      <dc:creator>Ashwin_DSA</dc:creator>
      <dc:date>2026-04-24T21:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: Handling New Columns Using Auto Loader Rescue Mode but how will get newly added column</title>
      <link>https://community.databricks.com/t5/databricks-free-edition-help/handling-new-columns-using-auto-loader-rescue-mode-but-how-will/m-p/155489#M769</link>
      <description>&lt;P&gt;Thank you quick response. We will check and get back you ...&lt;/P&gt;</description>
      <pubDate>Sat, 25 Apr 2026 14:20:09 GMT</pubDate>
      <guid>https://community.databricks.com/t5/databricks-free-edition-help/handling-new-columns-using-auto-loader-rescue-mode-but-how-will/m-p/155489#M769</guid>
      <dc:creator>SantiNath_Dey</dc:creator>
      <dc:date>2026-04-25T14:20:09Z</dc:date>
    </item>
  </channel>
</rss>

