bereng commented on code in PR #2110: URL: https://github.com/apache/cassandra/pull/2110#discussion_r1098331856
########## src/java/org/apache/cassandra/cql3/functions/masking/ColumnMask.java: ########## @@ -0,0 +1,252 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.cassandra.cql3.functions.masking; + +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.concurrent.TimeUnit; + +import com.google.common.base.Joiner; +import com.google.common.collect.ImmutableList; + +import org.apache.commons.lang3.StringUtils; + +import org.apache.cassandra.config.DatabaseDescriptor; +import org.apache.cassandra.cql3.AssignmentTestable; +import org.apache.cassandra.cql3.CQL3Type; +import org.apache.cassandra.cql3.ColumnIdentifier; +import org.apache.cassandra.cql3.CqlBuilder; +import org.apache.cassandra.cql3.Term; +import org.apache.cassandra.cql3.Terms; +import org.apache.cassandra.cql3.functions.Function; +import org.apache.cassandra.cql3.functions.FunctionName; +import org.apache.cassandra.cql3.functions.FunctionResolver; +import org.apache.cassandra.cql3.functions.ScalarFunction; +import org.apache.cassandra.db.marshal.AbstractType; +import org.apache.cassandra.db.marshal.ReversedType; +import org.apache.cassandra.gms.Gossiper; +import org.apache.cassandra.transport.ProtocolVersion; +import org.apache.cassandra.utils.CassandraVersion; + +import static org.apache.cassandra.cql3.statements.RequestValidations.invalidRequest; + +/** + * Dynamic data mask that can be applied to a schema column. + * <p> + * It consists on a partial application of a certain {@link MaskingFunction} to the values of a column, with the + * precondition that the type of any masked column is compatible with the type of the first argument of the function. + * <p> + * This partial application is meant to be associated to specific columns in the schema, acting as a mask for the values + * of those columns. It's associated to queries such as: + * <pre> + * CREATE TABLE %t (k int PRIMARY KEY, v int MASKED WITH mask_inner(1, 1); Review Comment: missing closing `) `? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

