[ 
https://issues.apache.org/jira/browse/CASSANDRA-5892?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Adam Masters updated CASSANDRA-5892:
------------------------------------

    Description: 
When using CqlPagingRecordReader, specifying a custom where clause using 
CqlConfigHelper.setInputWhereClauses() throws an exception when a GT (>) 
comparator is used.

Exception:
java.lang.RuntimeException at 
org.apache.cassandra.hadoop.cql3.CqlPagingRecordReader$RowIterator.executeQuery(CqlPagingRecordReader.java:646)
 Caused by: InvalidRequestException(why:Invalid restrictions found on ts) at 
org.apache.cassandra.thrift.Cassandra$prepare_cql3_query_result.read(Cassandra.java:39567)

This is due to the paging mechanism inserting a GT comparator on the same 
composite key as the custom where clause, resulting in an invalid CQL 
statement. For example ("ts > '634926385000000000'" being the custom where 
clause):

SELECT * FROM "test_cf"
    WHERE token("key") = token( ? )  AND "ts" > ?
    AND ts > '634926385000000000' LIMIT 3 ALLOW FILTERING

  was:
When using CqlPagingRecordReader, specifying a custom where clause using 
CqlConfigHelper.setInputWhereClauses() throws an exception when a GT (>) 
comparator is used.

Exception:
java.lang.RuntimeException at 
org.apache.cassandra.hadoop.cql3.CqlPagingRecordReader$RowIterator.executeQuery(CqlPagingRecordReader.java:646)
 Caused by: InvalidRequestException(why:Invalid restrictions found on ts) at 
org.apache.cassandra.thrift.Cassandra$prepare_cql3_query_result.read(Cassandra.java:39567)

This is due to the paging mechanism inserting a GT comparator on the same 
composite key as the custom where clause, resulting in an invalid CQL 
statement. For example ("ts > '634926385000000000'" being the custom where 
clause):

SELECT * FROM "test_cf"
    WHERE token("key") = token(?)  AND "ts" > ?
    AND ts > '634926385000000000' LIMIT 3 ALLOW FILTERING

    
> CqlConfigHelper.setInputWhereClauses() doesnt handle GT (>) comparators
> -----------------------------------------------------------------------
>
>                 Key: CASSANDRA-5892
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-5892
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Hadoop
>            Reporter: Adam Masters
>            Priority: Minor
>             Fix For: 1.2.8
>
>
> When using CqlPagingRecordReader, specifying a custom where clause using 
> CqlConfigHelper.setInputWhereClauses() throws an exception when a GT (>) 
> comparator is used.
> Exception:
> java.lang.RuntimeException at 
> org.apache.cassandra.hadoop.cql3.CqlPagingRecordReader$RowIterator.executeQuery(CqlPagingRecordReader.java:646)
>  Caused by: InvalidRequestException(why:Invalid restrictions found on ts) at 
> org.apache.cassandra.thrift.Cassandra$prepare_cql3_query_result.read(Cassandra.java:39567)
> This is due to the paging mechanism inserting a GT comparator on the same 
> composite key as the custom where clause, resulting in an invalid CQL 
> statement. For example ("ts > '634926385000000000'" being the custom where 
> clause):
> SELECT * FROM "test_cf"
>     WHERE token("key") = token( ? )  AND "ts" > ?
>     AND ts > '634926385000000000' LIMIT 3 ALLOW FILTERING

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to