Subqueries are not supported in the DELETE

2,048 views
Skip to first unread message

Eoin O'Hehir

unread,
Nov 10, 2021, 9:48:18 AM11/10/21
to Delta Lake Users and Developers
Hi,

I am trying to DELETE from a Delta Lake table using Spark SQL similar to

          DELETE FROM myTable1
         WHERE EXISTS (Select 1 from myTable2 where myTable2.key = myTable1.key)

When I attempt this I get a "Subqueries are not supported in the DELETE" error.

I noticed that this functionality is available on Delta Lake on DataBricks (https://docs.databricks.com/spark/latest/spark-sql/language-manual/delta-delete-from.html)

Are there any plans to introduce this functionality to the Open sourced version of Delta Lake ?

Versions:
Spark: 3.1.2
Delta Lake: 1.0.0 (Open source)

Thanks,

Eoin.

Tathagata Das

unread,
Nov 10, 2021, 2:16:51 PM11/10/21
to Eoin O'Hehir, Delta Lake Users and Developers
Yes, we are considering adding subquery support in Delete. Here is the issue to track it - https://github.com/delta-io/delta/issues/826

Thank you for reporting.

TD

--
You received this message because you are subscribed to the Google Groups "Delta Lake Users and Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to delta-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/delta-users/3690556a-5e63-46e6-8cb1-c31831242c6bn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages