Created on 04-26-2017 10:50 PM - edited 09-16-2022 04:31 AM
hi,
Dose Kudu support increment update?
For example, we have a table with two field, browser and visit count :
borwser visitCount
firfox 10
And then, we got a new visit from firfox, the table will be update to:
borwser visitCount
firfox 11
we want to do this update by increment operation, ranther then read the visitCount, add one and write it back.
Thanks in advance.
Created 04-27-2017 07:50 AM
Hi,
Kudu currently doesn't support atomic increments or any kind of operation that reads a value and makes a decision based on that value with the guarantee that it won't change.
Thx,
J-D
Created 04-27-2017 07:50 AM
Hi,
Kudu currently doesn't support atomic increments or any kind of operation that reads a value and makes a decision based on that value with the guarantee that it won't change.
Thx,
J-D
Created 06-19-2017 01:19 AM
Created 06-19-2017 03:21 AM
I think it is just because how Kudu is implemented. The visit count is not the primary key of the table. Nor the browser column. For atomic incrementing you have to have the data in one location on one server.
Created 08-25-2017 02:20 PM
"Nor the browser column" -- What if the "browser" column WAS the primary key? Would increment be possible in similar fashion to upsert, the difference being that internally Kudu would read the existing value and add it to the increment value before saving?
Created 08-28-2017 09:03 AM
@hindog wrote:"Nor the browser column" -- What if the "browser" column WAS the primary key? Would increment be possible in similar fashion to upsert, the difference being that internally Kudu would read the existing value and add it to the increment value before saving?
The other Kudu limitation that this runs into is that row key columns cannot be modified. It would be somewhat easier to implement atomic increments on non-key columns, but then that means doing a lot of updates and it's not something Kudu excels at e.g. it supports modifying data but the higher the rate the slower the reads are.