We only transition to allow filtering and only if we've not already set it.
This commit is contained in:
parent
d1fe54b0ce
commit
864c4af5af
1 changed files with 17 additions and 15 deletions
|
@ -291,21 +291,23 @@ public final class SelectOperation<E> extends AbstractFilterStreamOperation<E, S
|
|||
where.and(filter.getClause(sessionOps.getValuePreparer()));
|
||||
HelenusProperty prop = filter.getNode().getProperty();
|
||||
boolean isFirstIndex = true;
|
||||
switch (prop.getColumnType()) {
|
||||
case PARTITION_KEY :
|
||||
case CLUSTERING_COLUMN :
|
||||
break;
|
||||
default :
|
||||
// When using non-Cassandra-standard 2i types or when using more than one
|
||||
// indexed column or non-indexed columns the query must include ALLOW FILTERING.
|
||||
if (prop.caseSensitiveIndex()) {
|
||||
allowFiltering = true;
|
||||
} else if (prop.getIndexName() != null) {
|
||||
allowFiltering |= !isFirstIndex;
|
||||
isFirstIndex = false;
|
||||
} else {
|
||||
allowFiltering = true;
|
||||
}
|
||||
if (allowFiltering == false) {
|
||||
switch (prop.getColumnType()) {
|
||||
case PARTITION_KEY :
|
||||
case CLUSTERING_COLUMN :
|
||||
break;
|
||||
default :
|
||||
// When using non-Cassandra-standard 2i types or when using more than one
|
||||
// indexed column or non-indexed columns the query must include ALLOW FILTERING.
|
||||
if (prop.caseSensitiveIndex()) {
|
||||
allowFiltering = true;
|
||||
} else if (prop.getIndexName() != null) {
|
||||
allowFiltering |= !isFirstIndex;
|
||||
isFirstIndex = false;
|
||||
} else {
|
||||
allowFiltering = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue