adelapena commented on code in PR #2146:
URL: https://github.com/apache/cassandra/pull/2146#discussion_r1105890618
##########
src/java/org/apache/cassandra/cql3/statements/SelectStatement.java:
##########
@@ -238,7 +239,21 @@ public void authorize(ClientState state) throws
InvalidRequestException, Unautho
for (Function function : getFunctions())
state.ensurePermission(Permission.EXECUTE, function);
- unmask = state.hasUnmaskPermission(table);
+ unmask = state.hasTablePermission(table, Permission.UNMASK);
+
+ if (!unmask && !state.hasTablePermission(table,
Permission.SELECT_MASKED))
+ {
+ List<ColumnMetadata> queriedMaskedColumns = table.columns()
+ .stream()
+
.filter(ColumnMetadata::isMasked)
Review Comment:
[`StatementRestrictions#isRestricted`](https://github.com/apache/cassandra/blob/cassandra-4.1.0/src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java#L341-L346)
involves building a collection [in most
cases](https://github.com/apache/cassandra/blob/cassandra-4.1.0/src/java/org/apache/cassandra/cql3/restrictions/SingleColumnRestriction.java#L60)
and then running a `List#contains`. In contrast, {{ColumnMetadata#isMasked}}
just returns a boolean. So I think `isMasked` is faster than is `isRestricted`.
--
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]