databaseignite

How to update a column of a table from other column of other table in Apache Ignite?


I have a cache cluster of Gridgain Ignite v8.8.29. I have two tables in it VOTE and VOTEDETAIL both have the same key columns. In VOTE table, one column with the name 'comment', has null values while the same column in the VOTEDETAIL table contains values. I want to update the null values of the comment column in VOTE with the values of the comment column in VOTEDETAIL for the matching key columns. Is there a way to do this in Apache Ignite?

I tried the following merge command:

MERGE INTO master.VOTE(voteId,uuid,batchId,address,phone,name,email,decision,comment,createdon, active)(SELECT voteId,uuid,batchId,address,phone,name,email,decision,comment,createdon, active FROM master.VOTEDETAIL where comment is NOT NULL)

However, this query is inserting the records in the VOTE tables with 'comment' values instead of updating the null in the existing record. I don't think Ignite supports Merge and When Matched statement, like other DB. Is there any other way to do this in Apache Ignite?


Solution

  • The MERGE command is (effectively) converted into a key-value put behind the scenes; it's more of an upsert than a merge.

    You might be able to do what you want with an UPDATE statement. Alternatively, you could find the records with a SELECT statement and update them using the key-value API (probably an entry processor).