any comments?

---------- Forwarded message ----------
From: Suresh Ayyavoo <sur...@iappsasia.com>
Date: Tue, Oct 17, 2017 at 4:40 PM
Subject: SPARK SQL update table based on condition
To: users@zeppelin.apache.org


Hi All,

Senario: update existing row based on column value in a table, this is how
it's done in SPARK SQL, i'm i doing right? is there any better way to do it
in spark sql?

1. Table (zeppelin-report) row should be updated based on column value

1. select * from table1 where id not in(select id from table1)
(filter the row that need to be updated)
SaveMode.Append (tableB) temp table

2. read new row and append to above table
SaveMode.Append (tableB) temp table

3. SaveMode.Overwrite(zeppelin-report)
This zeppelin report table data is dropped

4.save tableB as Zeppelin-report table

5.SaveMode.Overwrite(tableB)
drop the value of temp table for reuse

Reply via email to