<?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: How to track the history of schema changes for a Delta table in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-to-track-the-history-of-schema-changes-for-a-delta-table/m-p/20779#M14069</link>
    <description>&lt;P&gt;When a write operation is performed with columns added. we are not explicitly showing that in&amp;nbsp;&lt;/P&gt;&lt;P&gt;DESCRIBE HISTORY output. Only an entry is made for write. and in the operation Parameters, it's not showing anything about schema evolution. whereas if we do&amp;nbsp;alter table&amp;nbsp;then that is shown explicitly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below code snippet queries the Delta transaction logs to give us the details about all the schema changes done on the table (Replace the table location with your Delta table location)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;spark.read.json("dbfs:/tmp/hari/delta/caching/test/2/_delta_log/*.json").createOrReplaceTempView("delta_log")
display(spark.sql("select metadata.schemaString,input_file_name() from delta_log where metadata is not null"))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 24 Jun 2021 09:14:44 GMT</pubDate>
    <dc:creator>brickster_2018</dc:creator>
    <dc:date>2021-06-24T09:14:44Z</dc:date>
    <item>
      <title>How to track the history of schema changes for a Delta table</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-track-the-history-of-schema-changes-for-a-delta-table/m-p/20778#M14068</link>
      <description>&lt;P&gt;I have a Delta table that had schema changes in multiple commits. I wanted to track all these schema changes that happened on the Delta table. The "DESCRIBE HISTORY" is not useful as it logs the schema change made by ALTER TABLE operations. &lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 09:12:23 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-track-the-history-of-schema-changes-for-a-delta-table/m-p/20778#M14068</guid>
      <dc:creator>brickster_2018</dc:creator>
      <dc:date>2021-06-24T09:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to track the history of schema changes for a Delta table</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-track-the-history-of-schema-changes-for-a-delta-table/m-p/20779#M14069</link>
      <description>&lt;P&gt;When a write operation is performed with columns added. we are not explicitly showing that in&amp;nbsp;&lt;/P&gt;&lt;P&gt;DESCRIBE HISTORY output. Only an entry is made for write. and in the operation Parameters, it's not showing anything about schema evolution. whereas if we do&amp;nbsp;alter table&amp;nbsp;then that is shown explicitly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below code snippet queries the Delta transaction logs to give us the details about all the schema changes done on the table (Replace the table location with your Delta table location)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;spark.read.json("dbfs:/tmp/hari/delta/caching/test/2/_delta_log/*.json").createOrReplaceTempView("delta_log")
display(spark.sql("select metadata.schemaString,input_file_name() from delta_log where metadata is not null"))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 09:14:44 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-track-the-history-of-schema-changes-for-a-delta-table/m-p/20779#M14069</guid>
      <dc:creator>brickster_2018</dc:creator>
      <dc:date>2021-06-24T09:14:44Z</dc:date>
    </item>
  </channel>
</rss>

