ekaterinadimitrova2 commented on code in PR #3444:
URL: https://github.com/apache/cassandra/pull/3444#discussion_r1725459263
##########
pylib/cqlshlib/test/test_cqlsh_completion.py:
##########
@@ -473,7 +473,7 @@ def test_complete_in_delete(self):
self.trycompletions('DELETE FROM twenty_rows_composite_table USING
TIMESTAMP 0 WHERE TOKEN(a ',
choices=[')', ','])
self.trycompletions('DELETE FROM twenty_rows_composite_table USING
TIMESTAMP 0 WHERE TOKEN(a) ',
- choices=['>=', '<=', '=', '<', '>'])
+ choices=['>=', '<=', '=', '<', '>', '!='])
Review Comment:
We do not support `!=` on token restrictions. NEQ stands with other eq
operators in Parser.g, allowed on token and because we allow all binary
operators with token functions, removing below from
`Relation#toRestriction(TableMetadata table, VariableSpecifications
boundNames)`:
```
if (operator == Operator.NEQ)
throw invalidRequest("Unsupported '!=' relation: %s", this);
```
led to allowing it for token functions.
I will special case the `!=` for tokens:
```
if (operator == Operator.NEQ && columnsExpression.kind() ==
ColumnsExpression.Kind.TOKEN)
throw invalidRequest("Unsupported '!=' relation: %s", this);
```
Thank you for catching it!!
--
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]