Athena Iceberg delete failing

1

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.

gefragt vor 2 Jahren1357 Aufrufe
4 Antworten
1

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.

beantwortet vor 2 Jahren
0

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.

AWS
beantwortet vor 2 Jahren
0

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

beantwortet vor 2 Jahren
0

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

MikeW
beantwortet vor einem Jahr

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen