Hi Arnaud, You're right that MERGE INTO isn't supported yet. What I've seen most people do is to implement the operation using SQL to select existing data and join it with new data, then overwrite part of the destination table with the replacement.
On Mon, Oct 12, 2020 at 2:10 PM Arnaud Nauwynck <arnaud.nauwy...@gmail.com> wrote: > Hi Iceberg dev team, > > I am trying to use iceberg to do "upsert" based on an event table > In pure SQL, it is unsupported yet > > Here is my example with 2 tables: "iceberg_table" should contain updated > data, and "table_event" contains event updates. > > scala> spark.sql(""" MERGE INTO db1.iceberg_table t USING db1.table_event > e ON e.id = t.id WHEN MATCHED THEN UPDATE SET t.data = e.data WHEN NOT > MATCHED THEN INSERT (id, data) VALUES (id, data) """).show() > .. > java.lang.UnsupportedOperationException: MERGE INTO TABLE is not supported > temporarily. > > Is there a way to execute it programmatically using Spark Api or Iceberg > Api? > Any idea when the sql feature might be available ? > > > Thanks in advance > > Regards, > Arnaud Nauwynck > > -- Ryan Blue Software Engineer Netflix