It seems that CASSANDRA-7575 is broken in Cassandra 3.x. As stated in the secondary indexes' API documentation, custom index implementations should perform any validation of query expressions at Index#searcherFor(ReadCommand), throwing an InvalidRequestException if the expressions are not valid. I assume these validation errors should produce an InvalidRequest error on cqlsh, or raise an InvalidQueryException on Java driver. However, when Index#searcherFor(ReadCommand) throws its InvalidRequestException, I get this cqlsh output:
I attach a dummy index implementation to reproduce the error:
This is specially problematic when using Cassandra Java Driver, because one of these server exceptions can produce subsequent queries fail (even if they are valid) with a no host available exception.
Maybe the validation method added with CASSANDRA-7575 should be restored, unless there is a way to properly manage the exception.