-
Notifications
You must be signed in to change notification settings - Fork 3.8k
CASSANDRA-17941 trunk: CQL data masking functions #1892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
979aa1c to
9883c99
Compare
blerer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patch. It is a nice work. The thing that worries me is the fact that some of the functions can change the type on the flight. It is not reflected at the ResultSet metadata level (so the type announced does not match the actual type) and it will also break queries that use selector chaining or that need to take the column type into account. It feels to me like a risky path.
Some how related we should be clear about what masking with null means. Numeric type normally represent null with an empty ByteBuffer, text columns do not support null value. We represent a missing column value through null is it what we want? It should not work for primary key components in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: The javadoc of 'getOrCreateFunction' should specify that the method can return null value. The annotation is here but it would better to have it specified in the the javadoc. I read the doc but did not pay attention to the annotation so I guess that others could do the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, added a comment on the JavaDoc for getOrCreateFunction, and also in the one for the internal doGetOrCreateFunction.
src/java/org/apache/cassandra/cql3/functions/masking/NullMaskingFunction.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking of selector chaining. Is it safe to change the column type on the flight? Do we also change the Resultset metadata?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On regular queries we do change the ResultSet metadata, I have added some specific testing for this. Selector chaining should work as with using any other function. That might be more tricky when we attach functions to columns at CASSANDRA-18068, and we probably should forbid attaching this kind of type-altering functions. But using them as regular functions on SELECT queries shouldn't be a problem.
9883c99 to
be0f98a
Compare
|
Thanks for the review. I have rebased the branch and tried to address the suggestions on an additional commit. CI:
As discussed on Slack, the proposed functions are taken into account in the However, we should take those return types into account during CASSANDRA-18068. On that ticket we will allow to attach the utility masking functions to table columns on Probably we will need to just forbid attaching type-altering masking functions to column definitions on |
9c830c3 to
6a9b654
Compare
patch by Andrés de la Peña; reviewed by Benjamin Lerer for CASSANDRA-17941
6a9b654 to
38ad22c
Compare
df3eb40 to
54e39a9
Compare
No description provided.