Forum Discussion

smpa01's avatar
smpa01
Community Champion
2 years ago

DELETE Managed DELTA Table

During a DEV, I am trying to ingest rows in a delta table and then refining the code further and then delete the rows from the table before running the next ingestion for a follow-up code DEV.

 

I am observing that even though, I run the following, the table is not entirely deleting all the rows in a lot of instances. When I refresh the lakehouse and that delta table to verify if it actually deleted all the rows, to my suprise I see the default view of 1000 rows. In reality, I expect it to be 0 rows.

 

 

%%sql
--DELETE all rows
DELETE FROM Staging.Lakehouse.dev_ingestion_tbl

 

 

It is causing me (time) to manually Delete (SQL TRUNCATE) the table from Lakehouse, run a schema building code to build an empty table to be ready for next test ingestion for enhanced DEV code.

 

Why does it keep on happening. I expect DELETE to completely delete all the rows each time I run it, ithout having me to verify the action.

 

Do I need to run (e.g. VACCUM) anything in conjunction to DELETE to make sure it does what I expect it to do.

 

Thank you in advance.

7 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, smpa01 

    After testing, after executing this T-SQL, the data in this table can be deleted normally, and then refresh, there is no data in the table in Lakehouse.Delete works fine in Notebook. Make sure you have permission to modify the table, retry deleting and refreshing.

    Notebook:


    Lakehouse:


    Best Regards,
    Yang

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    If I misunderstand your needs or you still have problems on it, please feel free to let us know.
    Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

    • smpa01's avatar
      smpa01
      Community Champion

      Anonymous  I see this however.

       

       

      " Make sure you have permission to modify the table, retry deleting and refreshing" - yes, I am the admin