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
Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!