apache /
kudu /
f20dcf57ad76e9b1bb57fe60b27ea3a8f02df233 KUDU-3353 [schema] Add an immutable attribute on column schema (part 3)
This is a follow-up to b6eedb224f715ad86378a92d25f09c2084b0e2b7.
This patch contains the Java client-side changes
of the "new column attribute IMMUTABLE" feature,
including:
1. Adds a new 'immutable(boolean immutable)' method to
class ColumnSchemaBuilder to add/remove IMMUTABLE
attribute to/from a column.
2. Adds a new 'isImmutable()' method to class
ColumnSchema to check if the attribute is set for
a column schema.
3. Adds a new 'hasImmutableColumns()' method to class
Schema to check if there's at least one immutable
column for a table schema.
4. Adds a new 'changeImmutable(String name, boolean immutable)'
method to class AlterTableOptions to change the
immutable attribute for a column.
5. Adds a new UpsertIgnore operation in the client API:
use the newly added KuduTable.newUpsertIgnore() to
create a new instance of such operation.
Both UpsertIgnore and UpdateIgnore operations can be used
to ignore errors on updating cells of immutable columns.
6. Adds unit tests to cover the newly introduced functionality.
Change-Id: Ifdfdcd123296803a3b5e856ec5eaac49c05b7f8d
Reviewed-on: http://gerrit.cloudera.org:8080/18993
Tested-by: Alexey Serbin <alexey@apache.org>
Reviewed-by: Alexey Serbin <alexey@apache.org>
17 files changed