adelapena commented on code in PR #2125:
URL: https://github.com/apache/cassandra/pull/2125#discussion_r1118763288
##########
src/java/org/apache/cassandra/cql3/selection/Selector.java:
##########
@@ -443,14 +447,21 @@ private <V> ByteBuffer value(Cell<V> c)
}
/**
- * Return the value of the column with the specified index.
+ * Return the value of the column with the specified index. If the
column the value belongs to is masked with a
+ * {@link ColumnMask} and {@link #unmask} hasn't been specified, such
mask will be applied to the value.
*
* @param index the column index
- * @return the value of the column with the specified index
+ * @return the value of the column with the specified index, masked if
its column is masked
*/
public ByteBuffer getValue(int index)
{
- return values[index];
+ ByteBuffer value = values[index];
Review Comment:
After some thought I believe we can keep the unmasked ordering with `ORDER
BY` in a quite reasonable way.
Currently, columns that are not selected but are needed by `ORDER BY`
post-ordering are temporarily included into the result, and later discarded. In
case the ordering column is also selected, then it's only included once in the
result set.
What we could do is including into the selection a `SimpleSelector` for
masked columns that are needed for ordering, but making that selector return
clear data. That clear column would be used for post-ordering and then
discarded. That means that if the ordering column is also selected there would
be two `SimpleSelector`s for that column, one for masked data and other for
clear data.
This approach should only collect the masked/clear data for the columns that
really need it, so it shouldn't incur in any performance cost if there aren't
masked columns of `ORDER BY` clauses.
I gave it a go in [the PR for
CASSANDRA-18068](https://github.com/apache/cassandra/pull/2110).
--
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]