<?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 Issue while writing data to unity catalog using JDBC in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/issue-while-writing-data-to-unity-catalog-using-jdbc/m-p/65539#M32835</link>
    <description>&lt;P&gt;While writing the data to a pre-existing table in the unity catalog using JDBC. it just writes the Delta of the data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Driver used:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;com.databricks:databricks-jdbc:2.6.36&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;Lets say I have the table has rows:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;+-+-+
|a|b| 
+-+-+
|1|2|
|3|4|&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;and I am appending the row using .union&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;+-+-+
|a|b|
+-+-+
|1|2|
+-+-+&lt;/LI-CODE&gt;&lt;P&gt;I am using a `.union` here after reading the table with the row to append which results to this in my logs&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;+-+-+
|a|b| 
+-+-+
|1|2|
|3|4|
+-+-+&lt;/LI-CODE&gt;&lt;P&gt;but after writing to table with mode ".overwrite" using jdbc&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;write_options = {"url": catalog_jdbc_url,
                         "driver": "com.databricks.client.jdbc.Driver"}
 (df.write.format("jdbc")
 .options(**write_options)
 .option("truncate", "true")
 .option("dbtable", table_name)
 .save(mode="overwrite"))&lt;/LI-CODE&gt;&lt;P&gt;the table just shows in the unity catalog:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;+-+-+
|a|b|
+-+-+
|1|2|
+-+-+&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Is there any reason for this or config issue?&lt;/P&gt;</description>
    <pubDate>Thu, 04 Apr 2024 21:28:54 GMT</pubDate>
    <dc:creator>DumbBeaver</dc:creator>
    <dc:date>2024-04-04T21:28:54Z</dc:date>
    <item>
      <title>Issue while writing data to unity catalog using JDBC</title>
      <link>https://community.databricks.com/t5/data-engineering/issue-while-writing-data-to-unity-catalog-using-jdbc/m-p/65539#M32835</link>
      <description>&lt;P&gt;While writing the data to a pre-existing table in the unity catalog using JDBC. it just writes the Delta of the data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Driver used:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;com.databricks:databricks-jdbc:2.6.36&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;Lets say I have the table has rows:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;+-+-+
|a|b| 
+-+-+
|1|2|
|3|4|&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;and I am appending the row using .union&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;+-+-+
|a|b|
+-+-+
|1|2|
+-+-+&lt;/LI-CODE&gt;&lt;P&gt;I am using a `.union` here after reading the table with the row to append which results to this in my logs&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;+-+-+
|a|b| 
+-+-+
|1|2|
|3|4|
+-+-+&lt;/LI-CODE&gt;&lt;P&gt;but after writing to table with mode ".overwrite" using jdbc&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;write_options = {"url": catalog_jdbc_url,
                         "driver": "com.databricks.client.jdbc.Driver"}
 (df.write.format("jdbc")
 .options(**write_options)
 .option("truncate", "true")
 .option("dbtable", table_name)
 .save(mode="overwrite"))&lt;/LI-CODE&gt;&lt;P&gt;the table just shows in the unity catalog:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;+-+-+
|a|b|
+-+-+
|1|2|
+-+-+&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Is there any reason for this or config issue?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 21:28:54 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/issue-while-writing-data-to-unity-catalog-using-jdbc/m-p/65539#M32835</guid>
      <dc:creator>DumbBeaver</dc:creator>
      <dc:date>2024-04-04T21:28:54Z</dc:date>
    </item>
  </channel>
</rss>

