JeremiahDJordan commented on code in PR #2673:
URL: https://github.com/apache/cassandra/pull/2673#discussion_r1357060159


##########
src/java/org/apache/cassandra/cql3/statements/SelectStatement.java:
##########
@@ -281,14 +288,29 @@ public ResultMessage.Rows execute(QueryState state, 
QueryOptions options, long q
 
         Selectors selectors = selection.newSelectors(options);
         AggregationSpecification aggregationSpec = getAggregationSpec(options);
-        ReadQuery query = getQuery(options, state.getClientState(), 
selectors.getColumnFilter(),
-                                   nowInSec, userLimit, userPerPartitionLimit, 
pageSize, aggregationSpec);
+        DataLimits limit = getDataLimits(userLimit, userPerPartitionLimit, 
pageSize, aggregationSpec);
+
+        // Handle additional validation for topK queries
+        if (restrictions.isTopK())
+        {
+            checkFalse(aggregationSpec != null, TOPK_AGGREGATION_ERROR);
+
+            checkFalse(options.getConsistency() != ConsistencyLevel.ONE &&

Review Comment:
   Rather than failing queries not using LOCAL_ONE/ONE I think we should 
downgrade the CL to ONE/LOCAL_ONE (depending on if the incoming query used 
LOCAL_) and set a Client Warn that it happened.
   It will be very painful for end users if they have tospecially manage that 
ANN read queries use ONE when everything else in their app is using 
LOCAL_QUORUM...



-- 
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]

Reply via email to