cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
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
Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.