oleole
Contributor

@Hubert Dudek​ Hello, I'm having the same issue with using UPDATE in spark sql and came across your answer. When you say "replace source_table_reference with view" in MERGE, do you mean to replace "P" with "VIEW" that looks something as below:

%sql
MERGE into MASTER.Product VIEW
using LooUp.Lookup_Table_Colors C ON VIEW.Name LIKE '% ' + C.Color_Name + '% (%'
WHEN MATCHED THEN UPDATE set VIEW.Product_Color =C.Color_Name;

Thanks in advance for your help!