Fix Inconsistent request behavior between datastax driver and cqlsh

String cql = "SELECT * FROM myks.tbl WHERE bid=? AND mid<? LIMIT ? ORDER BY mid DESC ALLOW FILTERING";  


If I execute this in cqlsh it works fine with or without ALLOW FILTERING added. If I execute this from the latest (2.1.1) datastax driver I get

com.datastax.driver.core.exceptions.InvalidQueryException: This request cannot be completed because it may involve data filtering and therefore may have unpredictable performance. If you want to execute this query despite performance unpredictability, use ALLOW FILTERING

It clearly works from the command line, so doesn't mean it should work from a driver. What to do?


source to share

All Articles