apache /
kudu /
b6eedb224f715ad86378a92d25f09c2084b0e2b7 KUDU-3353 [schema] Add an immutable attribute on column schema (part 1)
The overview of design:
1. Add a new column attribute IMMUTABLE, meaning the column cell
value can not be updated after it's been written during inserting
the row.
2. An attempt to modify an immutable cell of an existing row by
UPDATE or UPSERT operation results in returning the newly added
Status::IsImmutable().
3. Use UPDATE_IGNORE and add UPSERT_IGNORE, for UPDATE and UPSERT
ops but ignore update errors on IMMUTABLE columns. Note that
the rest of the columns are updated accordingly to the
operation's data, only the immutable columns aren't changed.
With this change, UPDATE_IGNORE ops ignore both 'key not found'
and 'update on immutable column' errors.
Some use cases:
1. A column represents a semantically constant entity. The
corresponding value is present in every row for a particular
primary key and might change, but it's captured upon the very
first occurrence. An example is 'first_login_timestamp' for
a particular user while 'login_timestamp' is present in every
login record.
2. Similar to the item 1, but the corresponding value, if present,
is the same with every record for a particular primary key.
Here the intention is to reduce the length of the column's
change list. An example is a 'birthday' column.
This patch includes the changes on the server side, proto files, and
necessary changes on the client side because of ColumnSchema
constructor's been changed.
Change-Id: I01e5a806c0e873239b49e6d0b37a7e36578b508d
Reviewed-on: http://gerrit.cloudera.org:8080/18742
Tested-by: Kudu Jenkins
Reviewed-by: Alexey Serbin <alexey@apache.org>
50 files changed