Athena Iceberg delete failing


I am trying to perform a fairly simple delete via Athena on a table defined with the tabletype of Iceberg.

delete from emaildelivery where uniqueid in (select b.uniqueid from deletestaging b)

The following error message is returned.

GENERIC_INTERNAL_ERROR: Invalid descendant for DeleteNode or UpdateNode: com.facebook.presto.sql.planner.plan.JoinNode

Performing the query with values directly in the query is successful.

delete from emaildelivery where uniqueid in ('6e41279b-a22d-4bad-ad8d-448625ae9d88','2831e5a1-8a5c-424f-8d07-198a57f6a04a')

The same query as a select works successfully.

select uniqueid from emaildelivery where uniqueid in (select b.uniqueid from deletestaging b);

Any assistance with resolving the issue with the delete query is greatly appreciated.

asked 2 years ago1414 views
4 Answers

Is there any update on this? I am currently stumbling on the same problem while testing Iceberg, and this is a key feature for our PoC.

answered 2 years ago

Hello, Thank you for brining on to the notice, Currently, this is a known issue only for DELETE and UPDATE. Athena Service team is actively working on it.

answered 2 years ago

Is there additional information related to when there will be a resolution to this issue?

answered 2 years ago

I had the same issue. The workaround which I found works for me is to use merge into .. with delete statement when there is a match. E.g. first create a table with the record ids that need to be deleted (emailtodelete). Then use it to delete the data from the original table.

MERGE INTO emaildelivery t USING emailtodelete s ON (t. uniqueid = s. uniqueid) WHEN MATCHED THEN DELETE

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions