i have to Update /Insert data in shopping_cart table only if some quantity is present in inventory table in cassandra , and this needs to be atomic operation as the invetory table is being updated frequently , I was trying to use a light weight transaction some thing like below
update shopping_cart
set
quantity=1
where
item='item1'
if
(select quantity from inventory where item='item1') = 2;
but i am getting an error
mismatch input '(' expecting K_NOT
probably light weight transaction is not the best way to do this also i think that if clause would not be supporting query from different table in cassandra .
so what would be the best way to achive the above operation in cassandra without compromising on atomicty .
Above type of a query wont be possible - two options I can think of,