<?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: Schema changes notification in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/schema-changes-notification/m-p/172462#M56642</link>
    <description>&lt;P&gt;Greetings &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/259440"&gt;@pharma70&lt;/a&gt;, I did some digging and here is what I found. The replies from &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/250064"&gt;@Satyasai&lt;/a&gt;, &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/245057"&gt;@suryaprayaga&lt;/a&gt;, and &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/249473"&gt;@ivanvyd&lt;/a&gt; each cover a piece of this, so I'll stitch them together.&lt;/P&gt;
&lt;P&gt;The right approach depends on how data arrives in Databricks.&lt;/P&gt;
&lt;P&gt;If you ingest files with Auto Loader&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;cloudFiles.schemaEvolutionMode = "rescue"&lt;/CODE&gt; is built for your exact requirement, as &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/249473"&gt;@ivanvyd&lt;/a&gt; and &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/245057"&gt;@suryaprayaga&lt;/a&gt; said. One detail that surprises people: Auto Loader's default mode (&lt;CODE&gt;addNewColumns&lt;/CODE&gt;) does fail the stream when a new column appears (an &lt;CODE&gt;UnknownFieldException&lt;/CODE&gt;) and relies on a job retry to continue. Rescue mode flips that. The schema never changes, the stream never stops, and anything that doesn't fit lands in &lt;CODE&gt;_rescued_data&lt;/CODE&gt; as a JSON string. Nothing is lost and downstream code keeps working.&lt;/P&gt;
&lt;P&gt;I'd pair it with an explicit approved schema so you control exactly what's "expected":&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="language-python"&gt;df = (spark.readStream.format("cloudFiles")
  .option("cloudFiles.format", "json")
  .schema(expected_schema)
  .option("cloudFiles.schemaEvolutionMode", "rescue")
  .option("rescuedDataColumn", "_rescued_data")
  .option("cloudFiles.schemaLocation", "/Volumes/cat/schema/_checkpoints/bronze")
  .load("/Volumes/cat/landing/source_a/"))
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For the notification, a plain &lt;CODE&gt;_rescued_data IS NOT NULL&lt;/CODE&gt; check tells you something drifted, but as Ivan noted it also fires on type and case mismatches. If you want the alert to say which new columns showed up, pull the keys out of the JSON (skipping the &lt;CODE&gt;_file_path&lt;/CODE&gt; key Auto Loader adds):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="language-sql"&gt;SELECT key AS new_column, COUNT(*) AS row_count, MIN(ingest_ts) AS first_seen
FROM (
  SELECT explode(map_keys(from_json(_rescued_data, 'MAP&amp;lt;STRING,STRING&amp;gt;'))) AS key,
         ingest_ts
  FROM cat.bronze.source_a
  WHERE _rescued_data IS NOT NULL
    AND ingest_ts &amp;gt;= current_timestamp() - INTERVAL 1 DAY
)
WHERE key &amp;lt;&amp;gt; '_file_path'
GROUP BY key
ORDER BY first_seen;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Save that as a Databricks SQL alert (condition: row count &amp;gt; 0) and route it to email, Slack, Teams, or a webhook. Add it as a SQL alert task right after ingestion in your Lakeflow Job; the task reports Succeeded whether or not the alert fires, so the workflow stays green while you still get told. Keep the time window tight to your run cadence, or log notified columns to a small table, so the same rescued rows don't alert you every run. If you'd rather classify changes (new, removed, renamed, type-changed), the schema-diff audit table &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/245057"&gt;@suryaprayaga&lt;/a&gt; described is a good step up from this.&lt;/P&gt;
&lt;P&gt;Once you've reviewed a column and want it, add it to &lt;CODE&gt;expected_schema&lt;/CODE&gt; (or to &lt;CODE&gt;cloudFiles.schemaHints&lt;/CODE&gt;) and it moves out of &lt;CODE&gt;_rescued_data&lt;/CODE&gt; on the next run.&lt;/P&gt;
&lt;P&gt;If the upstream team writes directly to a Delta table&lt;/P&gt;
&lt;P&gt;Here the schema has already evolved by the time you see it, so &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/250064"&gt;@Satyasai&lt;/a&gt;'s approach fits: look at what happened to the table. &lt;CODE&gt;DESCRIBE HISTORY&lt;/CODE&gt; shows an &lt;CODE&gt;ADD COLUMNS&lt;/CODE&gt; operation with the column names in &lt;CODE&gt;operationParameters&lt;/CODE&gt;, and &lt;CODE&gt;system.access.audit&lt;/CODE&gt; records the same &lt;CODE&gt;addColumns&lt;/CODE&gt; event account-wide if you have system table access. Either can feed the same SQL alert pattern. Just note this detects DDL on Delta or Unity Catalog tables; it won't see a new field in raw JSON or CSV files, which is what rescue mode is for.&lt;/P&gt;
&lt;P&gt;References&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Auto Loader schema inference and evolution: &lt;A href="https://docs.databricks.com/aws/en/ingestion/cloud-object-storage/auto-loader/schema" target="_blank"&gt;https://docs.databricks.com/aws/en/ingestion/cloud-object-storage/auto-loader/schema&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Auto Loader common patterns: &lt;A href="https://docs.databricks.com/aws/en/ingestion/cloud-object-storage/auto-loader/patterns" target="_blank"&gt;https://docs.databricks.com/aws/en/ingestion/cloud-object-storage/auto-loader/patterns&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Databricks SQL alerts: &lt;A href="https://docs.databricks.com/aws/en/sql/user/alerts/" target="_blank"&gt;https://docs.databricks.com/aws/en/sql/user/alerts/&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;SQL alert task for Lakeflow Jobs: &lt;A href="https://docs.databricks.com/aws/en/jobs/tasks/alert" target="_blank"&gt;https://docs.databricks.com/aws/en/jobs/tasks/alert&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Delta table history schema: &lt;A href="https://docs.databricks.com/aws/en/tables/history-schema" target="_blank"&gt;https://docs.databricks.com/aws/en/tables/history-schema&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Audit log system table: &lt;A href="https://docs.databricks.com/aws/en/admin/system-tables/audit-logs" target="_blank"&gt;https://docs.databricks.com/aws/en/admin/system-tables/audit-logs&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;
&lt;P&gt;Regards, Louis.&lt;/P&gt;</description>
    <pubDate>Fri, 09 Oct 2026 13:32:06 GMT</pubDate>
    <dc:creator>Louis_Frolio</dc:creator>
    <dc:date>2026-10-09T13:32:06Z</dc:date>
    <item>
      <title>Schema changes notification</title>
      <link>https://community.databricks.com/t5/data-engineering/schema-changes-notification/m-p/169313#M56081</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Sometimes an upstream source adds a new column without letting us know. We do not want the Databricks workflow to fail when this happens, but we would like to be notified so we can review the new column and decide whether to include it in our processing later.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is there a Databricks-native way to detect and alert on schema changes, while allowing the pipeline to continue running normally?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2026 11:48:27 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/schema-changes-notification/m-p/169313#M56081</guid>
      <dc:creator>pharma70</dc:creator>
      <dc:date>2026-09-21T11:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: Schema changes notification</title>
      <link>https://community.databricks.com/t5/data-engineering/schema-changes-notification/m-p/169316#M56082</link>
      <description>&lt;P&gt;Write a Databrciks Alerts with following sql server Query&lt;/P&gt;&lt;P&gt;SELECT&lt;BR /&gt;event_time,&lt;BR /&gt;user_identity.email AS triggered_by,&lt;BR /&gt;request_params.table_full_name AS table_name,&lt;BR /&gt;action_name,&lt;BR /&gt;request_params&lt;BR /&gt;FROM system.access.audit&lt;BR /&gt;WHERE action_name = 'addColumns'&lt;BR /&gt;AND request_params.table_full_name = 'catalog.schema.bronze_table'&lt;BR /&gt;AND event_time &amp;gt;= NOW() - INTERVAL 1 DAY;&lt;/P&gt;&lt;P&gt;Navigate to SQL editor -&amp;gt; Alerts -&amp;gt; Create Alert.&lt;/P&gt;&lt;P&gt;Set alert conditions to trigger when query result has Rows &amp;gt; 0.&lt;/P&gt;&lt;P&gt;Configure alert notifications to be delivered via Email, Slack, Microsoft Teams or Webhook/PagerDuty.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2026 12:26:21 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/schema-changes-notification/m-p/169316#M56082</guid>
      <dc:creator>Satyasai</dc:creator>
      <dc:date>2026-09-21T12:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: Schema changes notification</title>
      <link>https://community.databricks.com/t5/data-engineering/schema-changes-notification/m-p/169317#M56083</link>
      <description>&lt;P&gt;This is a good question.&amp;nbsp;Databricks Auto Loader specifically supports a "rescue schema-evolution" mode where new columns don't cause the stream to fail; unexpected fields are placed into a rescued-data column.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Besides we could safely introduce what is called as "Schema Change Detection Layer" that detects what changed between the incoming data stream vs the expected / approved schema. Take a look at a simple scenario like this:&lt;/P&gt;&lt;P&gt;(Expected Schema - Incoming Schema) --&amp;gt; New columns, Removed Columns, Schema changes, Renamed columns.&lt;/P&gt;&lt;P&gt;We could simply store such results in an audit table something with the following structure:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="suryaprayaga_0-1789993513561.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/31342i8B0DD223397E8866/image-size/medium?v=v2&amp;amp;px=400" role="button" title="suryaprayaga_0-1789993513561.png" alt="suryaprayaga_0-1789993513561.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Though this capture is per-se not native within Datbaricks (others can correct me), you can perhaps use a native Databricks ability to do notification via Slack or Pager Duty.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;SP&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2026 12:27:19 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/schema-changes-notification/m-p/169317#M56083</guid>
      <dc:creator>suryaprayaga</dc:creator>
      <dc:date>2026-09-21T12:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: Schema changes notification</title>
      <link>https://community.databricks.com/t5/data-engineering/schema-changes-notification/m-p/169341#M56088</link>
      <description>&lt;P class=""&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/259440"&gt;@pharma70&lt;/a&gt;&amp;nbsp;if this ingestion is using Auto Loader, &lt;EM&gt;cloudFiles.schemaEvolutionMode = "rescue"&lt;/EM&gt;&amp;nbsp;seems like a good fit here. In that mode Auto Loader keeps the stream running, does not evolve the schema, and puts new fields into &lt;EM&gt;_rescued_data&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;You can then alert on recent bronze rows where &lt;EM&gt;_rescued_data IS NOT NULL&lt;/EM&gt;. If this runs through Lakeflow Jobs, the alert can be added as a SQL Alert task after ingestion. One useful detail is that a triggered alert still reports the task as &lt;EM&gt;Succeeded&lt;/EM&gt;; the task only fails if alert evaluation itself errors.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;_rescued_data&lt;/EM&gt; also captures type and case mismatches, so for a strict "new column" notification I'd filter the rescued fields against the approved schema first.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2026 13:59:19 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/schema-changes-notification/m-p/169341#M56088</guid>
      <dc:creator>ivanvyd</dc:creator>
      <dc:date>2026-09-21T13:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: Schema changes notification</title>
      <link>https://community.databricks.com/t5/data-engineering/schema-changes-notification/m-p/172462#M56642</link>
      <description>&lt;P&gt;Greetings &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/259440"&gt;@pharma70&lt;/a&gt;, I did some digging and here is what I found. The replies from &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/250064"&gt;@Satyasai&lt;/a&gt;, &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/245057"&gt;@suryaprayaga&lt;/a&gt;, and &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/249473"&gt;@ivanvyd&lt;/a&gt; each cover a piece of this, so I'll stitch them together.&lt;/P&gt;
&lt;P&gt;The right approach depends on how data arrives in Databricks.&lt;/P&gt;
&lt;P&gt;If you ingest files with Auto Loader&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;cloudFiles.schemaEvolutionMode = "rescue"&lt;/CODE&gt; is built for your exact requirement, as &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/249473"&gt;@ivanvyd&lt;/a&gt; and &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/245057"&gt;@suryaprayaga&lt;/a&gt; said. One detail that surprises people: Auto Loader's default mode (&lt;CODE&gt;addNewColumns&lt;/CODE&gt;) does fail the stream when a new column appears (an &lt;CODE&gt;UnknownFieldException&lt;/CODE&gt;) and relies on a job retry to continue. Rescue mode flips that. The schema never changes, the stream never stops, and anything that doesn't fit lands in &lt;CODE&gt;_rescued_data&lt;/CODE&gt; as a JSON string. Nothing is lost and downstream code keeps working.&lt;/P&gt;
&lt;P&gt;I'd pair it with an explicit approved schema so you control exactly what's "expected":&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="language-python"&gt;df = (spark.readStream.format("cloudFiles")
  .option("cloudFiles.format", "json")
  .schema(expected_schema)
  .option("cloudFiles.schemaEvolutionMode", "rescue")
  .option("rescuedDataColumn", "_rescued_data")
  .option("cloudFiles.schemaLocation", "/Volumes/cat/schema/_checkpoints/bronze")
  .load("/Volumes/cat/landing/source_a/"))
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For the notification, a plain &lt;CODE&gt;_rescued_data IS NOT NULL&lt;/CODE&gt; check tells you something drifted, but as Ivan noted it also fires on type and case mismatches. If you want the alert to say which new columns showed up, pull the keys out of the JSON (skipping the &lt;CODE&gt;_file_path&lt;/CODE&gt; key Auto Loader adds):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="language-sql"&gt;SELECT key AS new_column, COUNT(*) AS row_count, MIN(ingest_ts) AS first_seen
FROM (
  SELECT explode(map_keys(from_json(_rescued_data, 'MAP&amp;lt;STRING,STRING&amp;gt;'))) AS key,
         ingest_ts
  FROM cat.bronze.source_a
  WHERE _rescued_data IS NOT NULL
    AND ingest_ts &amp;gt;= current_timestamp() - INTERVAL 1 DAY
)
WHERE key &amp;lt;&amp;gt; '_file_path'
GROUP BY key
ORDER BY first_seen;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Save that as a Databricks SQL alert (condition: row count &amp;gt; 0) and route it to email, Slack, Teams, or a webhook. Add it as a SQL alert task right after ingestion in your Lakeflow Job; the task reports Succeeded whether or not the alert fires, so the workflow stays green while you still get told. Keep the time window tight to your run cadence, or log notified columns to a small table, so the same rescued rows don't alert you every run. If you'd rather classify changes (new, removed, renamed, type-changed), the schema-diff audit table &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/245057"&gt;@suryaprayaga&lt;/a&gt; described is a good step up from this.&lt;/P&gt;
&lt;P&gt;Once you've reviewed a column and want it, add it to &lt;CODE&gt;expected_schema&lt;/CODE&gt; (or to &lt;CODE&gt;cloudFiles.schemaHints&lt;/CODE&gt;) and it moves out of &lt;CODE&gt;_rescued_data&lt;/CODE&gt; on the next run.&lt;/P&gt;
&lt;P&gt;If the upstream team writes directly to a Delta table&lt;/P&gt;
&lt;P&gt;Here the schema has already evolved by the time you see it, so &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/250064"&gt;@Satyasai&lt;/a&gt;'s approach fits: look at what happened to the table. &lt;CODE&gt;DESCRIBE HISTORY&lt;/CODE&gt; shows an &lt;CODE&gt;ADD COLUMNS&lt;/CODE&gt; operation with the column names in &lt;CODE&gt;operationParameters&lt;/CODE&gt;, and &lt;CODE&gt;system.access.audit&lt;/CODE&gt; records the same &lt;CODE&gt;addColumns&lt;/CODE&gt; event account-wide if you have system table access. Either can feed the same SQL alert pattern. Just note this detects DDL on Delta or Unity Catalog tables; it won't see a new field in raw JSON or CSV files, which is what rescue mode is for.&lt;/P&gt;
&lt;P&gt;References&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Auto Loader schema inference and evolution: &lt;A href="https://docs.databricks.com/aws/en/ingestion/cloud-object-storage/auto-loader/schema" target="_blank"&gt;https://docs.databricks.com/aws/en/ingestion/cloud-object-storage/auto-loader/schema&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Auto Loader common patterns: &lt;A href="https://docs.databricks.com/aws/en/ingestion/cloud-object-storage/auto-loader/patterns" target="_blank"&gt;https://docs.databricks.com/aws/en/ingestion/cloud-object-storage/auto-loader/patterns&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Databricks SQL alerts: &lt;A href="https://docs.databricks.com/aws/en/sql/user/alerts/" target="_blank"&gt;https://docs.databricks.com/aws/en/sql/user/alerts/&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;SQL alert task for Lakeflow Jobs: &lt;A href="https://docs.databricks.com/aws/en/jobs/tasks/alert" target="_blank"&gt;https://docs.databricks.com/aws/en/jobs/tasks/alert&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Delta table history schema: &lt;A href="https://docs.databricks.com/aws/en/tables/history-schema" target="_blank"&gt;https://docs.databricks.com/aws/en/tables/history-schema&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Audit log system table: &lt;A href="https://docs.databricks.com/aws/en/admin/system-tables/audit-logs" target="_blank"&gt;https://docs.databricks.com/aws/en/admin/system-tables/audit-logs&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;
&lt;P&gt;Regards, Louis.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Oct 2026 13:32:06 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/schema-changes-notification/m-p/172462#M56642</guid>
      <dc:creator>Louis_Frolio</dc:creator>
      <dc:date>2026-10-09T13:32:06Z</dc:date>
    </item>
  </channel>
</rss>

