<?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: Unable to change the index, when writing to a Azure SQL Data Warehouse in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/unable-to-change-the-index-when-writing-to-a-azure-sql-data/m-p/25908#M18080</link>
    <description>&lt;P&gt;For avoiding duplicates during append you can set index in sql with options: "is Unique"=Yes and  "Ignore Duplicate Keys"=Yes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Spark/databricks don't know what is in database that's why you have duplicates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Truncate option is for overwrite mode only as than instead of DROP TABLE in SQL it makes TRUNCATE TABLE so schema survive.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding error probably in SQL you have separated CLUSTERED  index but I am not sure.&lt;/P&gt;</description>
    <pubDate>Thu, 10 Mar 2022 17:33:52 GMT</pubDate>
    <dc:creator>Hubert-Dudek</dc:creator>
    <dc:date>2022-03-10T17:33:52Z</dc:date>
    <item>
      <title>Unable to change the index, when writing to a Azure SQL Data Warehouse</title>
      <link>https://community.databricks.com/t5/data-engineering/unable-to-change-the-index-when-writing-to-a-azure-sql-data/m-p/25907#M18079</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have some data in a spark data frame and I am trying to write it to a table in Azure SQL Data Warehouse. If I use df.write.mode(saveMode="overwrite") I get this error:&lt;/P&gt;&lt;P&gt;com.microsoft.sqlserver.jdbc.SQLServerException: The statement failed. Column &amp;amp;#39;code&amp;amp;#39; has a data type that cannot participate in a columnstore index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess its trying to create the end table using with a columnstore index. I need a way to specify that the create statement not create the end table with a column store index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The other issue is if I change that to df.write.option("truncate",True).mode(saveMode="append") and run it a few times (after manually creating the table the first time), I end up with duplicate records in the end table. That basically means that the "truncate" option isn't working&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Rajesh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 16:38:21 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unable-to-change-the-index-when-writing-to-a-azure-sql-data/m-p/25907#M18079</guid>
      <dc:creator>Rajesh_M</dc:creator>
      <dc:date>2022-03-10T16:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to change the index, when writing to a Azure SQL Data Warehouse</title>
      <link>https://community.databricks.com/t5/data-engineering/unable-to-change-the-index-when-writing-to-a-azure-sql-data/m-p/25908#M18080</link>
      <description>&lt;P&gt;For avoiding duplicates during append you can set index in sql with options: "is Unique"=Yes and  "Ignore Duplicate Keys"=Yes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Spark/databricks don't know what is in database that's why you have duplicates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Truncate option is for overwrite mode only as than instead of DROP TABLE in SQL it makes TRUNCATE TABLE so schema survive.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding error probably in SQL you have separated CLUSTERED  index but I am not sure.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 17:33:52 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unable-to-change-the-index-when-writing-to-a-azure-sql-data/m-p/25908#M18080</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2022-03-10T17:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to change the index, when writing to a Azure SQL Data Warehouse</title>
      <link>https://community.databricks.com/t5/data-engineering/unable-to-change-the-index-when-writing-to-a-azure-sql-data/m-p/25909#M18081</link>
      <description>&lt;P&gt;Thanks @Hubert Dudek​&amp;nbsp;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you know if there is a way to run a create table statement on Azure Synapse/Azure SQL Datawarehouse from Databricks?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 18:28:26 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unable-to-change-the-index-when-writing-to-a-azure-sql-data/m-p/25909#M18081</guid>
      <dc:creator>Rajesh_M</dc:creator>
      <dc:date>2022-03-10T18:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to change the index, when writing to a Azure SQL Data Warehouse</title>
      <link>https://community.databricks.com/t5/data-engineering/unable-to-change-the-index-when-writing-to-a-azure-sql-data/m-p/25910#M18082</link>
      <description>&lt;P&gt;Yes, it is possible, as they both use blob storage. As architecture like this is more complex, you need to go through the manual; there are a lot of examples: &lt;A href="https://docs.microsoft.com/en-us/azure/databricks/data/data-sources/azure/synapse-analytics" target="test_blank"&gt;https://docs.microsoft.com/en-us/azure/databricks/data/data-sources/azure/synapse-analytics&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Apr 2022 09:38:05 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unable-to-change-the-index-when-writing-to-a-azure-sql-data/m-p/25910#M18082</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2022-04-18T09:38:05Z</dc:date>
    </item>
  </channel>
</rss>

