phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhang yun <>
Subject Re: How to support UPSERT with WHERE clause
Date Mon, 16 Jul 2018 08:32:40 GMT
Now Phoenix don not support where clause within upsert. I also think this function is very
important that use frequency is  highly.

Maybe the dialect looks like this:
Upset into  scheme.table_name set col=‘x’ where id=‘x’

This semantic to implement is easy in Phoenix, we just need once write rpc if where condition
can hit rowKey

On 2018/07/14 23:54:38, alchemist <> wrote: 
> Looks like UPSERT doesn't support a WHERE clause.> 
> But people have used workaroung like following:> 
> UPSERT INTO test.MyTable(col1, col2) SELECT col3, col4 FROM test.TempTable> 
> WHERE col5 = ABC> 
> Does that mean If I have a use case where I need to update all the columns> 
> of the MyTable based on some key, I need to add the data to be updated in> 
> another TempTable then use a command similar to above to update data of the> 
> MyTable.  Please let me know if my understanding is correct.  Somehow adding> 
> data in another table just to update source table does not seems correct.> 
> --> 
> Sent from:> 
View raw message