<?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 do you delete specific rows from a Lakehouse table? in Pipelines</title>
    <link>https://community.fabric.microsoft.com/t5/Pipelines/How-do-you-delete-specific-rows-from-a-Lakehouse-table/m-p/3902591#M3154</link>
    <description>&lt;P&gt;Right, "&amp;lt;", "&amp;gt;" and "=" type of comparisons work.&lt;/P&gt;&lt;P&gt;Problem is only with the word "IN".&lt;/P&gt;</description>
    <pubDate>Wed, 08 May 2024 14:30:22 GMT</pubDate>
    <dc:creator>TimoRiikonen</dc:creator>
    <dc:date>2024-05-08T14:30:22Z</dc:date>
    <item>
      <title>How do you delete specific rows from a Lakehouse table?</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-do-you-delete-specific-rows-from-a-Lakehouse-table/m-p/3468967#M770</link>
      <description>&lt;P&gt;Greetings, all. I have some files loaded into a Lakehouse that I've also loaded into a Lakehouse table. I want to delete some of the rows in the Lakehouse table, but I can't seem to find a way to do that. How does one go about doing this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2023 13:46:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-do-you-delete-specific-rows-from-a-Lakehouse-table/m-p/3468967#M770</guid>
      <dc:creator>arpost</dc:creator>
      <dc:date>2023-10-10T13:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do you delete specific rows from a Lakehouse table?</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-do-you-delete-specific-rows-from-a-Lakehouse-table/m-p/3469450#M772</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="307993" data-lia-user-login="arpost" class="lia-mention lia-mention-user"&gt;arpost&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;Thanks for using Fabric Community.&lt;/P&gt;
&lt;P&gt;It is possible to delete rows in a Lakehouse table using Spark-SQL in notebooks. I have created a repro of the scenario. I have attached the screenshots for your reference.&lt;BR /&gt;Trying to delete the row which has value of 46134&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;Query succeeded&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;After deletion of the row:&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;You can refer this link for more information:&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/azure/databricks/sql/language-manual/delta-delete-from" target="_self"&gt;Link1&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;Hope this helps. Do let us know if you have any further issues. Glad to help.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2023 17:27:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-do-you-delete-specific-rows-from-a-Lakehouse-table/m-p/3469450#M772</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-10-10T17:27:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do you delete specific rows from a Lakehouse table?</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-do-you-delete-specific-rows-from-a-Lakehouse-table/m-p/3469475#M773</link>
      <description>&lt;P&gt;Appreciate it,&amp;nbsp;Anonymous&lt;/a&gt;! I was hoping there was a way to do it through a UI, but that works.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2023 17:39:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-do-you-delete-specific-rows-from-a-Lakehouse-table/m-p/3469475#M773</guid>
      <dc:creator>arpost</dc:creator>
      <dc:date>2023-10-10T17:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do you delete specific rows from a Lakehouse table?</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-do-you-delete-specific-rows-from-a-Lakehouse-table/m-p/3469505#M774</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="307993" data-lia-user-login="arpost" class="lia-mention lia-mention-user"&gt;arpost&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;Glad that your query got resolved. Please continue using Fabric Community for help on your queries.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2023 18:06:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-do-you-delete-specific-rows-from-a-Lakehouse-table/m-p/3469505#M774</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-10-10T18:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do you delete specific rows from a Lakehouse table?</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-do-you-delete-specific-rows-from-a-Lakehouse-table/m-p/3678752#M1753</link>
      <description>&lt;P&gt;I'm new to SparkSQL.&amp;nbsp; Would anyone happen to know how to acheive the following SQL statement?&amp;nbsp; I get the error:&amp;nbsp;&lt;EM&gt;&amp;nbsp;Error: Subqueries are not supported in the DELETE&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2" color="#0000FF"&gt;&lt;EM&gt;%%SQL&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2" color="#0000FF"&gt;&lt;EM&gt;DELETE FROM &amp;lt;Table&amp;gt;&lt;BR /&gt;WHERE [ImportDate] &amp;lt; (SELECT MAX([ImportDate]) FROM &amp;lt;Table&amp;gt;)&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Sun, 04 Feb 2024 21:08:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-do-you-delete-specific-rows-from-a-Lakehouse-table/m-p/3678752#M1753</guid>
      <dc:creator>YOUNG99</dc:creator>
      <dc:date>2024-02-04T21:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do you delete specific rows from a Lakehouse table?</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-do-you-delete-specific-rows-from-a-Lakehouse-table/m-p/3864590#M2857</link>
      <description>&lt;P&gt;I have the same problem: subqueries are not supported in delete.&lt;/P&gt;&lt;P&gt;I tried to create a temporary table and make a join, but that failed as well.&lt;/P&gt;&lt;P&gt;Since I have only two values, I can hard code my case for now.&lt;/P&gt;&lt;P&gt;Original deletion query:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DELETE FROM DE_LH_200_SILVER_Default.ServiceRequest WHERE updated NOT IN (select distinct DATE(updated) from DE_LH_100_BRONZE_Default.ServiceRequest)&lt;/LI-CODE&gt;&lt;P&gt;&lt;STRONG&gt;Failed&lt;/STRONG&gt; attempt with temp table and join:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CREATE TABLE deletecontent 
(
    todelete DATE
);
INSERT INTO deletecontent
    select distinct DATE(updated) from DE_LH_200_SILVER_Default.ServiceRequest WHERE updated NOT IN (select distinct DATE(updated) from DE_LH_100_BRONZE_Default.ServiceRequest);
SELECT * FROM deletecontent;
SELECT DISTINCT DATE(updated) FROM DE_LH_200_SILVER_Default.ServiceRequest INNER JOIN deletecontent ON deletecontent.todelete = DE_LH_200_SILVER_Default.ServiceRequest.updated;
DELETE FROM DE_LH_200_SILVER_Default.ServiceRequest SR INNER JOIN deletecontent ON deletecontent.todelete = DE_LH_200_SILVER_Default.ServiceRequest.updated;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 07:45:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-do-you-delete-specific-rows-from-a-Lakehouse-table/m-p/3864590#M2857</guid>
      <dc:creator>TimoRiikonen</dc:creator>
      <dc:date>2024-04-24T07:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do you delete specific rows from a Lakehouse table?</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-do-you-delete-specific-rows-from-a-Lakehouse-table/m-p/3902118#M3147</link>
      <description>&lt;P&gt;I'm trying to do something similar too. Did you find a solution? Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 12:12:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-do-you-delete-specific-rows-from-a-Lakehouse-table/m-p/3902118#M3147</guid>
      <dc:creator>CalebCarter927</dc:creator>
      <dc:date>2024-05-08T12:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do you delete specific rows from a Lakehouse table?</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-do-you-delete-specific-rows-from-a-Lakehouse-table/m-p/3902149#M3148</link>
      <description>&lt;P&gt;It doesn't work in a programmatic manner.&lt;/P&gt;&lt;P&gt;If you have pre-defined solution, then you can make the SQL command.&lt;BR /&gt;But if you for example create a table of keys and try to delete those rows, that is not possible atm.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Couple of options:&lt;BR /&gt;- Delete everything and recreate all of it without the lines you wanted to delete.&lt;/P&gt;&lt;P&gt;- Use Power Query filtering in dataflow and make the dataflow to overwrite the data.&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 12:30:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-do-you-delete-specific-rows-from-a-Lakehouse-table/m-p/3902149#M3148</guid>
      <dc:creator>TimoRiikonen</dc:creator>
      <dc:date>2024-05-08T12:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do you delete specific rows from a Lakehouse table?</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-do-you-delete-specific-rows-from-a-Lakehouse-table/m-p/3902579#M3153</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="630300" data-lia-user-login="CalebCarter927" class="lia-mention lia-mention-user"&gt;CalebCarter927&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Give the below a try.&amp;nbsp; I won't take credit for it.&amp;nbsp; It was given to me by a MSFT trainer when I proposed the question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;----------------------------------------------------------&lt;/P&gt;&lt;P&gt;%%pyspark&lt;/P&gt;&lt;P&gt;df = spark.sql("SELECT MAX(DataDate) MDate FROM Lakehouse.Table")&lt;/P&gt;&lt;P&gt;MDate = df.agg({"MDate":"max"}).collect()[0]['max(MDate)']&lt;BR /&gt;#print(MDate)&lt;/P&gt;&lt;P&gt;sqlStr = "DELETE From Lakehouse.Table WHERE DataDate &amp;lt; '"+str(MDate)+"'"&lt;BR /&gt;#print(sqlStr)&lt;/P&gt;&lt;P&gt;#dfDistinct = spark.sql("SELECT DISTINCT DataDate FROM Lakehouse.Table")&lt;BR /&gt;#display(dfDistinct)&lt;/P&gt;&lt;P&gt;dml = spark.sql(sqlStr)&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 14:26:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-do-you-delete-specific-rows-from-a-Lakehouse-table/m-p/3902579#M3153</guid>
      <dc:creator>YOUNG99</dc:creator>
      <dc:date>2024-05-08T14:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: How do you delete specific rows from a Lakehouse table?</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-do-you-delete-specific-rows-from-a-Lakehouse-table/m-p/3902591#M3154</link>
      <description>&lt;P&gt;Right, "&amp;lt;", "&amp;gt;" and "=" type of comparisons work.&lt;/P&gt;&lt;P&gt;Problem is only with the word "IN".&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 14:30:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-do-you-delete-specific-rows-from-a-Lakehouse-table/m-p/3902591#M3154</guid>
      <dc:creator>TimoRiikonen</dc:creator>
      <dc:date>2024-05-08T14:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do you delete specific rows from a Lakehouse table?</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-do-you-delete-specific-rows-from-a-Lakehouse-table/m-p/4402591#M7040</link>
      <description>&lt;P&gt;I went exactly the same way but it doesn´t work for me. Are there any bugs at the moment?&lt;BR /&gt;Everything is fine without the where clause (deleting all the data) but not with a where clause, regardless if it´s a clause to text or date column.&lt;BR /&gt;&lt;BR /&gt;Any suggestions?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2025 09:11:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-do-you-delete-specific-rows-from-a-Lakehouse-table/m-p/4402591#M7040</guid>
      <dc:creator>BaBallero</dc:creator>
      <dc:date>2025-02-10T09:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: How do you delete specific rows from a Lakehouse table?</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-do-you-delete-specific-rows-from-a-Lakehouse-table/m-p/4402784#M7042</link>
      <description>&lt;P&gt;These discussions should be still valid for Lakehouses (and probably Warehouses) without schema.&lt;/P&gt;&lt;P&gt;I heard that Lakehouse with schema has more deletion issues.&lt;/P&gt;&lt;P&gt;Is this the case?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2025 11:25:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-do-you-delete-specific-rows-from-a-Lakehouse-table/m-p/4402784#M7042</guid>
      <dc:creator>TimoRiikonen</dc:creator>
      <dc:date>2025-02-10T11:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do you delete specific rows from a Lakehouse table?</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-do-you-delete-specific-rows-from-a-Lakehouse-table/m-p/4413549#M7099</link>
      <description>&lt;P&gt;It seems to be something with timeout - when I delete just 150 rows, everything works fine!&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DELETE&lt;/SPAN&gt; &lt;SPAN&gt;FROM&lt;/SPAN&gt; &lt;SPAN&gt;`Table`&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;WHERE&lt;/SPAN&gt;&lt;SPAN&gt; attribute&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;'ABC'&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;BR /&gt;&lt;BR /&gt;But when I change the attribute die 'BCA', which is many thousands of rows in the table, it crashes with the following message:&lt;BR /&gt;INCONSISTENT_BEHAVIOR_CROSS_VERSION.READ_ANCIENT_DATETIME&lt;BR /&gt;I don´t see any connection to datetime in this?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Happy for any idea...&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 17 Feb 2025 10:13:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-do-you-delete-specific-rows-from-a-Lakehouse-table/m-p/4413549#M7099</guid>
      <dc:creator>BaBallero</dc:creator>
      <dc:date>2025-02-17T10:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: How do you delete specific rows from a Lakehouse table?</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-do-you-delete-specific-rows-from-a-Lakehouse-table/m-p/4413553#M7100</link>
      <description>&lt;P&gt;No, I´m using a Lakehouse without schema.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 10:15:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-do-you-delete-specific-rows-from-a-Lakehouse-table/m-p/4413553#M7100</guid>
      <dc:creator>BaBallero</dc:creator>
      <dc:date>2025-02-17T10:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do you delete specific rows from a Lakehouse table?</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/How-do-you-delete-specific-rows-from-a-Lakehouse-table/m-p/4414772#M7107</link>
      <description>&lt;P&gt;How are trying to delete have you tried the pyspark method above?&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2025 02:48:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/How-do-you-delete-specific-rows-from-a-Lakehouse-table/m-p/4414772#M7107</guid>
      <dc:creator>YOUNG99</dc:creator>
      <dc:date>2025-02-18T02:48:27Z</dc:date>
    </item>
  </channel>
</rss>

