cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

AssertionError: assertion failed: Unable to delete the record but I am able to select it though

User16826994223
Honored Contributor III

Is there any reason this command works well:

%sql 
SELECT * FROM  datanase.table WHERE  salary > 1000

returning 2 rows, while the below:

%sql 
delete FROM  datanase.table WHERE  salary > 1000

Error

Error in SQL statement: AssertionError: assertion failed: No plan for DeleteFromTable

2 REPLIES 2

User16826994223
Honored Contributor III

DELETE FROM (and similarly UPDAT. aren't supported on the Parquet files - right now on Databricks, it's supported for Delta format. You can convert your parquet files into delta using CONVERT TO DELTA, and then this command will work for you.

Have multiple questions on converting to delta.

  1. When I tried to covert as DELTA, then I cant access the parquet files using spark.read.parquet
  2. If converted to delta, then i ran a delete command for a filter example> where id = 1001. After the query execution, this data for id 1001 will be deleted from the underlying files or it will present, but not returned when running query

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group