Ridwan
Ridwan

Reputation: 363

Does delta lake support update with join?

Is it possible to do update on a delta lake table with join? In mysql (and other databases) you could something like

update table x 
join table y on y.a=x.a 
set x.b=y.b
where x.c='something'

Do we have something similar in delta? I know they support in and exists clause. Their documentation does not seem to mention anything about update join

Upvotes: 0

Views: 2125

Answers (1)

Dipesh Patel
Dipesh Patel

Reputation: 67

You can achieve it with MERGE INTO command. Something like:

    merge into x using y
    on (x.a=y.a and x.c='something')
    when matched then
    update set x.b=y.b;

Upvotes: 1

Related Questions