Hi I am using SnappyData and trying to update Table_A
with rows from Table_B
:
Table_A(key1, key2, val, primary key(key1, key2)) -- cumulative results
Table_B(key1, key2, val, primary key(key1, key2)) -- new rows - updates
Since the Table_B
would contain (key1, key2) values that already exist in Table_A
, and should replace those in Table_A
. So I am using the "PUT INTO" instead of "INSERT INTO" statements to update the cumulative results stored in Table_A
And my PUT INTO statement looks like this:
PUT INTO Table_A
SELECT * from Table_B
But the rows in Table_B
does not show up in Table_A
.
However if I insert values directly:
PUT INTO Table_A
VALUES (1, 1, 1)
the row (1, 1, 1) does show up in Table_A
. And if I use INSERT:
INSERT INTO Table_A
SELECT * from Table_B
The rows from Table_B
show up in Table_A
, until there is a dup key error and my program exits.
I tried single column primary key (i.e. key1) and still no luck.
So what am I doing wrong here? Or is the "PUT INTO" not working or is there a delay in "PUT INTO" statements?
UPDATE:
I was using SnappyData local mode, and I just tried cluster mode and encountered some error here (strange it does not throw the error in local mode, instead it's just not working silently.)