<?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: Best Practice for Handling Schema Evolution with Auto Loader in Production? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/best-practice-for-handling-schema-evolution-with-auto-loader-in/m-p/168383#M55915</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/248581"&gt;@Islam_hoti&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;This is a central design decision for any production-grade Lakehouse. In my experience architecting petabyte-scale environments, the goal is to&amp;nbsp;minimize "Pipeline Friction" without sacrificing "Data Governance."&lt;/P&gt;&lt;P&gt;Here is the "Architectural Standard" I recommend for this scenario:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;The Bronze Strategy: "Capture Everything"&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;In the Bronze layer, your primary goal is to ensure that no data is lost due to upstream changes.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Mode:&amp;nbsp;I recommend staying with&amp;nbsp;addNewColumns&amp;nbsp;but&amp;nbsp;always&amp;nbsp;combining it with&amp;nbsp;rescuedDataColumn.&lt;/LI&gt;&lt;LI&gt;Why:&amp;nbsp;rescuedDataColumn&amp;nbsp;acts as your "safety net." If a field changes in a way that&amp;nbsp;addNewColumns&amp;nbsp;can’t handle (like a data type conflict), the data isn't lost; it’s captured in a JSON blob for later recovery.&lt;/LI&gt;&lt;LI&gt;The Restart:&amp;nbsp;The&amp;nbsp;UnknownFieldException&amp;nbsp;and subsequent restart are actually a "feature," not a bug. It ensures the state/checkpoint is updated with the new metadata. In a&amp;nbsp;Lakeflow Job, configuring an automatic retry makes this process transparent and self-healing.&lt;/LI&gt;&lt;/UL&gt;&lt;OL&gt;&lt;LI&gt;The Silver Strategy: "Enforce and Cleanse"&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;This is where you solve the "Silent Schema Change" problem. While Bronze is flexible, Silver should be&amp;nbsp;strict.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;We allow Bronze to evolve automatically to keep the lights on.&lt;/LI&gt;&lt;LI&gt;In the Silver transformation, we use&amp;nbsp;Schema Enforcement. If the new column in Bronze isn't explicitly handled in your Silver logic, it simply stays in Bronze until an engineer or architect decides how to map it. This prevents "junk" columns from polluting your business-ready tables.&lt;/LI&gt;&lt;/UL&gt;&lt;OL&gt;&lt;LI&gt;The Modern Twist: Type Widening &amp;amp; Unity Catalog&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;If you are on a recent Databricks Runtime (13.3+), you should definitely evaluate&amp;nbsp;Type Widening. It allows Auto Loader to evolve a column from an&amp;nbsp;INT&amp;nbsp;to a&amp;nbsp;BIGINT&amp;nbsp;without failing the stream or requiring a rewrite of the Delta table. Under&amp;nbsp;Unity Catalog, this is managed seamlessly, ensuring that your governance and lineage remain intact even as the schema grows.&lt;/P&gt;&lt;P&gt;For a production environment, I prefer&amp;nbsp;Option 1 (Auto-restart) + Option 2 (Rescue Mode). Enforcing the schema at the ingestion layer (Bronze) is a recipe for operational headaches—upstream teams will inevitably break your pipeline. By capturing the change in Bronze and enforcing the logic in Silver, you maintain&amp;nbsp;high availability&amp;nbsp;while keeping&amp;nbsp;strict governance&amp;nbsp;where it matters most.&lt;/P&gt;</description>
    <pubDate>Fri, 11 Sep 2026 15:36:15 GMT</pubDate>
    <dc:creator>Khasim_1</dc:creator>
    <dc:date>2026-09-11T15:36:15Z</dc:date>
    <item>
      <title>Best Practice for Handling Schema Evolution with Auto Loader in Production?</title>
      <link>https://community.databricks.com/t5/data-engineering/best-practice-for-handling-schema-evolution-with-auto-loader-in/m-p/168382#M55914</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi Databricks Community,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I’d like to hear how other Data Engineers are handling schema evolution with Auto Loader in production environments.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Consider the following scenario:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We have a continuously running ingestion pipeline using Auto Loader that processes JSON files into a Bronze Delta table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;df = (&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;spark.readStream&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;.format("cloudFiles")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;.option("cloudFiles.format", "json")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;.option("cloudFiles.schemaLocation", schema_path)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;.option("cloudFiles.schemaEvolutionMode", "addNewColumns")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;.load(source_path)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Everything works as expected until the source system introduces a new column.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;With &lt;/SPAN&gt;&lt;SPAN&gt;addNewColumns&lt;/SPAN&gt;&lt;SPAN&gt;, Auto Loader detects the new field and updates the schema, but the stream can stop with an &lt;/SPAN&gt;&lt;SPAN&gt;UnknownFieldException&lt;/SPAN&gt;&lt;SPAN&gt; before continuing after a restart.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For a production pipeline, I see a few possible approaches:&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;Keep &lt;/SPAN&gt;&lt;SPAN&gt;addNewColumns&lt;/SPAN&gt;&lt;SPAN&gt; and configure the Lakeflow Job to restart automatically.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Use &lt;/SPAN&gt;&lt;SPAN&gt;rescue&lt;/SPAN&gt;&lt;SPAN&gt; mode and capture unexpected fields in &lt;/SPAN&gt;&lt;SPAN&gt;_rescued_data&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Use schema hints for fields that we expect could change.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Use &lt;/SPAN&gt;&lt;SPAN&gt;addNewColumnsWithTypeWidening&lt;/SPAN&gt;&lt;SPAN&gt; where supported when compatible data type changes are also expected.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN&gt;My main question is:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What approach do you consider the best practice for production pipelines where upstream schemas can change frequently?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I’m particularly interested in how you balance:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;• Pipeline availability&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;• Automatic schema evolution&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;• Data quality&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;• Avoiding silent schema changes&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;• Governance with Unity Catalog&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;• Operational maintenance&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Would you allow schema evolution automatically in the Bronze layer and enforce a stricter schema in Silver, or would you enforce the schema from the ingestion layer?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Interested to hear how others are designing this in real-world Databricks architectures.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#Databricks #DataEngineering #AutoLoader #StructuredStreaming #Lakeflow #DeltaLake #UnityCatalog&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2026 15:27:19 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/best-practice-for-handling-schema-evolution-with-auto-loader-in/m-p/168382#M55914</guid>
      <dc:creator>Islam_hoti</dc:creator>
      <dc:date>2026-09-11T15:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: Best Practice for Handling Schema Evolution with Auto Loader in Production?</title>
      <link>https://community.databricks.com/t5/data-engineering/best-practice-for-handling-schema-evolution-with-auto-loader-in/m-p/168383#M55915</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/248581"&gt;@Islam_hoti&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;This is a central design decision for any production-grade Lakehouse. In my experience architecting petabyte-scale environments, the goal is to&amp;nbsp;minimize "Pipeline Friction" without sacrificing "Data Governance."&lt;/P&gt;&lt;P&gt;Here is the "Architectural Standard" I recommend for this scenario:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;The Bronze Strategy: "Capture Everything"&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;In the Bronze layer, your primary goal is to ensure that no data is lost due to upstream changes.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Mode:&amp;nbsp;I recommend staying with&amp;nbsp;addNewColumns&amp;nbsp;but&amp;nbsp;always&amp;nbsp;combining it with&amp;nbsp;rescuedDataColumn.&lt;/LI&gt;&lt;LI&gt;Why:&amp;nbsp;rescuedDataColumn&amp;nbsp;acts as your "safety net." If a field changes in a way that&amp;nbsp;addNewColumns&amp;nbsp;can’t handle (like a data type conflict), the data isn't lost; it’s captured in a JSON blob for later recovery.&lt;/LI&gt;&lt;LI&gt;The Restart:&amp;nbsp;The&amp;nbsp;UnknownFieldException&amp;nbsp;and subsequent restart are actually a "feature," not a bug. It ensures the state/checkpoint is updated with the new metadata. In a&amp;nbsp;Lakeflow Job, configuring an automatic retry makes this process transparent and self-healing.&lt;/LI&gt;&lt;/UL&gt;&lt;OL&gt;&lt;LI&gt;The Silver Strategy: "Enforce and Cleanse"&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;This is where you solve the "Silent Schema Change" problem. While Bronze is flexible, Silver should be&amp;nbsp;strict.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;We allow Bronze to evolve automatically to keep the lights on.&lt;/LI&gt;&lt;LI&gt;In the Silver transformation, we use&amp;nbsp;Schema Enforcement. If the new column in Bronze isn't explicitly handled in your Silver logic, it simply stays in Bronze until an engineer or architect decides how to map it. This prevents "junk" columns from polluting your business-ready tables.&lt;/LI&gt;&lt;/UL&gt;&lt;OL&gt;&lt;LI&gt;The Modern Twist: Type Widening &amp;amp; Unity Catalog&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;If you are on a recent Databricks Runtime (13.3+), you should definitely evaluate&amp;nbsp;Type Widening. It allows Auto Loader to evolve a column from an&amp;nbsp;INT&amp;nbsp;to a&amp;nbsp;BIGINT&amp;nbsp;without failing the stream or requiring a rewrite of the Delta table. Under&amp;nbsp;Unity Catalog, this is managed seamlessly, ensuring that your governance and lineage remain intact even as the schema grows.&lt;/P&gt;&lt;P&gt;For a production environment, I prefer&amp;nbsp;Option 1 (Auto-restart) + Option 2 (Rescue Mode). Enforcing the schema at the ingestion layer (Bronze) is a recipe for operational headaches—upstream teams will inevitably break your pipeline. By capturing the change in Bronze and enforcing the logic in Silver, you maintain&amp;nbsp;high availability&amp;nbsp;while keeping&amp;nbsp;strict governance&amp;nbsp;where it matters most.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2026 15:36:15 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/best-practice-for-handling-schema-evolution-with-auto-loader-in/m-p/168383#M55915</guid>
      <dc:creator>Khasim_1</dc:creator>
      <dc:date>2026-09-11T15:36:15Z</dc:date>
    </item>
  </channel>
</rss>

