[
https://issues.apache.org/jira/browse/CASSANDRA-18068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17689293#comment-17689293
]
Andres de la Peña commented on CASSANDRA-18068:
-----------------------------------------------
At the moment the syntax for creating a table with masked columns is:
{code:java}
CREATE TABLE t1(k int MASKED WITH mask_replace(-1) PRIMARY KEY);
CREATE TABLE t2(k int,
c int,
s int STATIC MASKED WITH mask_replace(-1),
PRIMARY KEY(k, c));
{code}
We can see that the mask definition appears before {{{}PRIMARY KEY{}}}, but
after {{{}STATIC{}}}.
I think it's preferable to consistently have the mask definition immediately
after the type definition, since they are closely related. Then it would come
the special {{PRIMARY KEY}} and {{STATIC}} keywords, which are more about the
position of the column. So it would look like:
{code:java}
CREATE TABLE t1(k int MASKED WITH mask_replace(-1) PRIMARY KEY);
CREATE TABLE t2(k int,
c int,
s int MASKED WITH mask_replace(-1) STATIC,
PRIMARY KEY(k, c));
{code}
I'm changing that bit with [this
commit|https://github.com/adelapena/cassandra/commit/d14b29dd4fe12b8f73b315cdeb50a52e3b8a7dca]
on top of the PR. Sorry to come up with this so late.
> Allow to attach native masking functions to table columns
> ---------------------------------------------------------
>
> Key: CASSANDRA-18068
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18068
> Project: Cassandra
> Issue Type: New Feature
> Components: Feature/Dynamic Data Masking
> Reporter: Andres de la Peña
> Assignee: Andres de la Peña
> Priority: Normal
> Time Spent: 8h
> Remaining Estimate: 0h
>
> Allow to attach the native masking functions added by CASSANDRA-17941 to
> table columns, as defined by
> [CEP-20|https://cwiki.apache.org/confluence/display/CASSANDRA/CEP-20%3A+Dynamic+Data+Masking].
>
> {{CREATE TABLE}} statements would look like:
> {code}
> > CREATE TABLE patients (
> id timeuuid PRIMARY KEY,
> name text MASKED WITH partial(2, 1),
> birth date MASKED WITH default()
> );
> > INSERT INTO patients(id, name, birth) VALUES (now(), 'alice', '1982-12-21);
>
> > SELECT name, birth FROM patients;
>
> name | birth
> ---------+------------
> alXXXXe | 1900-01-01
> {code}
> {{ALTER TABLE}} statements would look like:
> {code}
> > ALTER TABLE patients ALTER name MASKED WITH partial(2, 1);
> > ALTER TABLE patients ALTER name WITHOUT MASK;
> {code}
> It won't be possible to use masked columns in the WHERE and IF clauses of
> SELECT and UPDATE statements.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]