You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Aaron Turner <sy...@gmail.com> on 2011/07/13 02:30:34 UTC

CQL + Counters = bad request

Using Cassandra 0.8.1 and cql 1.0.3 and following the syntax mentioned
in https://issues.apache.org/jira/browse/CASSANDRA-2473

cqlsh> UPDATE RouterAggWeekly SET 1310367600 = 1310367600 + 17 WHERE
KEY = '1_20110728_ifoutmulticastpkts';
Bad Request: line 1:51 no viable alternative at character '+'

Column names are Long's, hence the INT = INT + INT

Ideas?

-- 
Aaron Turner
http://synfin.net/         Twitter: @synfinatic
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix & Windows
Those who would give up essential Liberty, to purchase a little temporary
Safety, deserve neither Liberty nor Safety.
    -- Benjamin Franklin
"carpe diem quam minimum credula postero"

Re: CQL + Counters = bad request

Posted by Nate McCall <na...@datastax.com>.
Yep there was an issue here. RPM has been updated to 0.8.1-2 and
deployed. Thanks for tracking this down.

On Wed, Jul 13, 2011 at 3:58 PM, Aaron Turner <sy...@gmail.com> wrote:
> Thanks.  Looks like we tracked down the problem to the datasax 0.8.1
> rpm is actually 0.8.0.
>
> rpm -qa | grep cassandra
> apache-cassandra08-0.8.1-1
>
> grep ' Cassandra version:' /var/log/cassandra/system.log | tail -1
> INFO [main] 2011-07-13 12:04:31,039 StorageService.java (line 368)
> Cassandra version: 0.8.0
>
>
>
> On Wed, Jul 13, 2011 at 11:40 AM, samal <sa...@wakya.in> wrote:
>>> >>> cqlsh> UPDATE RouterAggWeekly SET 1310367600 = 1310367600 + 17 WHERE
>>> >>> KEY = '1_20110728_ifoutmulticastpkts';
>>> >>> Bad Request: line 1:51 no viable alternative at character '+'
>>
>> I m able to insert it.
>> _______________________
>> cqlsh>
>> cqlsh>  UPDATE counts SET 1310367600 = 1310367600 + 17 WHERE KEY =
>> '1_20110728_ifoutmulticastpkts';
>> cqlsh>  UPDATE counts SET 1310367600 = 1310367600 + 17 WHERE KEY =
>> '1_20110728_ifoutmulticastpkts';
>> cqlsh>
>> _____________________________
>> [default@test] list counts;
>> Using default limit of 100
>> -------------------
>> RowKey: 1_20110728_ifoutmulticastpkts
>> => (counter=12, value=16)
>> => (counter=1310367600, value=34)
>> -------------------
>> RowKey: 1
>> => (counter=1, value=10)
>> 2 Rows Returned.
>> [default@test]
>>
>
>
>
> --
> Aaron Turner
> http://synfin.net/         Twitter: @synfinatic
> http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix & Windows
> Those who would give up essential Liberty, to purchase a little temporary
> Safety, deserve neither Liberty nor Safety.
>     -- Benjamin Franklin
> "carpe diem quam minimum credula postero"
>

Re: CQL + Counters = bad request

Posted by Aaron Turner <sy...@gmail.com>.
Thanks.  Looks like we tracked down the problem to the datasax 0.8.1
rpm is actually 0.8.0.

rpm -qa | grep cassandra
apache-cassandra08-0.8.1-1

grep ' Cassandra version:' /var/log/cassandra/system.log | tail -1
INFO [main] 2011-07-13 12:04:31,039 StorageService.java (line 368)
Cassandra version: 0.8.0



On Wed, Jul 13, 2011 at 11:40 AM, samal <sa...@wakya.in> wrote:
>> >>> cqlsh> UPDATE RouterAggWeekly SET 1310367600 = 1310367600 + 17 WHERE
>> >>> KEY = '1_20110728_ifoutmulticastpkts';
>> >>> Bad Request: line 1:51 no viable alternative at character '+'
>
> I m able to insert it.
> _______________________
> cqlsh>
> cqlsh>  UPDATE counts SET 1310367600 = 1310367600 + 17 WHERE KEY =
> '1_20110728_ifoutmulticastpkts';
> cqlsh>  UPDATE counts SET 1310367600 = 1310367600 + 17 WHERE KEY =
> '1_20110728_ifoutmulticastpkts';
> cqlsh>
> _____________________________
> [default@test] list counts;
> Using default limit of 100
> -------------------
> RowKey: 1_20110728_ifoutmulticastpkts
> => (counter=12, value=16)
> => (counter=1310367600, value=34)
> -------------------
> RowKey: 1
> => (counter=1, value=10)
> 2 Rows Returned.
> [default@test]
>



-- 
Aaron Turner
http://synfin.net/         Twitter: @synfinatic
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix & Windows
Those who would give up essential Liberty, to purchase a little temporary
Safety, deserve neither Liberty nor Safety.
    -- Benjamin Franklin
"carpe diem quam minimum credula postero"

Re: CQL + Counters = bad request

Posted by samal <sa...@wakya.in>.
>
> >>> cqlsh> UPDATE RouterAggWeekly SET 1310367600 = 1310367600 + 17 WHERE
> >>> KEY = '1_20110728_ifoutmulticastpkts';
> >>> Bad Request: line 1:51 no viable alternative at character '+'
>

I m able to insert it.
_______________________

cqlsh>
cqlsh>  UPDATE counts SET 1310367600 = 1310367600 + 17 WHERE KEY =
'1_20110728_ifoutmulticastpkts';
cqlsh>  UPDATE counts SET 1310367600 = 1310367600 + 17 WHERE KEY =
'1_20110728_ifoutmulticastpkts';
cqlsh>
_____________________________
[default@test] list counts;
Using default limit of 100
-------------------
RowKey: 1_20110728_ifoutmulticastpkts
=> (counter=12, value=16)
=> (counter=1310367600, value=34)
-------------------
RowKey: 1
=> (counter=1, value=10)

2 Rows Returned.
[default@test]

Re: CQL + Counters = bad request

Posted by Aaron Turner <sy...@gmail.com>.
I've tried using the Thrift/execute_cql_query() API as well, and it
doesn't work either.  I've also tried using a CF where the column
names are of AsciiType to see if that was the problem (quoted and
unquoted column names) and I get the exact same error of: no viable
alternative at character '+'

Frankly, I'm about ready to open a ticket against 0.8.1 saying
CQL/Counter support does not work at all.

Or is there a trick which isn't documented in the ticket?  I tried
reading the Java code referred to in ticket #2473, but i'm over my
head.

On Tue, Jul 12, 2011 at 6:46 PM, Aaron Turner <sy...@gmail.com> wrote:
> Doesn't seem to help:
>
> cqlsh> UPDATE RouterAggWeekly SET '1310367600' = '1310367600' + 17
> WHERE KEY = '1_20110728_ifoutmulticastpkts';
> Bad Request: line 1:55 no viable alternative at character '+'
>
> cqlsh> UPDATE RouterAggWeekly SET 1310367600 = '1310367600' + 17 WHERE
> KEY = '1_20110728_ifoutmulticastpkts';
> Bad Request: line 1:53 no viable alternative at character '+'
>
> cqlsh> UPDATE RouterAggWeekly SET '1310367600' = 1310367600 + 17 WHERE
> KEY = '1_20110728_ifoutmulticastpkts';
> Bad Request: line 1:53 no viable alternative at character '+'
>
> On Tue, Jul 12, 2011 at 5:35 PM, Jonathan Ellis <jb...@gmail.com> wrote:
>> Try quoting the column name.
>>
>> On Tue, Jul 12, 2011 at 5:30 PM, Aaron Turner <sy...@gmail.com> wrote:
>>> Using Cassandra 0.8.1 and cql 1.0.3 and following the syntax mentioned
>>> in https://issues.apache.org/jira/browse/CASSANDRA-2473
>>>
>>> cqlsh> UPDATE RouterAggWeekly SET 1310367600 = 1310367600 + 17 WHERE
>>> KEY = '1_20110728_ifoutmulticastpkts';
>>> Bad Request: line 1:51 no viable alternative at character '+'
>>>
>>> Column names are Long's, hence the INT = INT + INT
>>>
>>> Ideas?
>>>
>>> --
>>> Aaron Turner
>>> http://synfin.net/         Twitter: @synfinatic
>>> http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix & Windows
>>> Those who would give up essential Liberty, to purchase a little temporary
>>> Safety, deserve neither Liberty nor Safety.
>>>     -- Benjamin Franklin
>>> "carpe diem quam minimum credula postero"
>>>
>>
>>
>>
>> --
>> Jonathan Ellis
>> Project Chair, Apache Cassandra
>> co-founder of DataStax, the source for professional Cassandra support
>> http://www.datastax.com
>>
>
>
>
> --
> Aaron Turner
> http://synfin.net/         Twitter: @synfinatic
> http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix & Windows
> Those who would give up essential Liberty, to purchase a little temporary
> Safety, deserve neither Liberty nor Safety.
>     -- Benjamin Franklin
> "carpe diem quam minimum credula postero"
>



-- 
Aaron Turner
http://synfin.net/         Twitter: @synfinatic
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix & Windows
Those who would give up essential Liberty, to purchase a little temporary
Safety, deserve neither Liberty nor Safety.
    -- Benjamin Franklin
"carpe diem quam minimum credula postero"

Re: CQL + Counters = bad request

Posted by Aaron Turner <sy...@gmail.com>.
Doesn't seem to help:

cqlsh> UPDATE RouterAggWeekly SET '1310367600' = '1310367600' + 17
WHERE KEY = '1_20110728_ifoutmulticastpkts';
Bad Request: line 1:55 no viable alternative at character '+'

cqlsh> UPDATE RouterAggWeekly SET 1310367600 = '1310367600' + 17 WHERE
KEY = '1_20110728_ifoutmulticastpkts';
Bad Request: line 1:53 no viable alternative at character '+'

cqlsh> UPDATE RouterAggWeekly SET '1310367600' = 1310367600 + 17 WHERE
KEY = '1_20110728_ifoutmulticastpkts';
Bad Request: line 1:53 no viable alternative at character '+'

On Tue, Jul 12, 2011 at 5:35 PM, Jonathan Ellis <jb...@gmail.com> wrote:
> Try quoting the column name.
>
> On Tue, Jul 12, 2011 at 5:30 PM, Aaron Turner <sy...@gmail.com> wrote:
>> Using Cassandra 0.8.1 and cql 1.0.3 and following the syntax mentioned
>> in https://issues.apache.org/jira/browse/CASSANDRA-2473
>>
>> cqlsh> UPDATE RouterAggWeekly SET 1310367600 = 1310367600 + 17 WHERE
>> KEY = '1_20110728_ifoutmulticastpkts';
>> Bad Request: line 1:51 no viable alternative at character '+'
>>
>> Column names are Long's, hence the INT = INT + INT
>>
>> Ideas?
>>
>> --
>> Aaron Turner
>> http://synfin.net/         Twitter: @synfinatic
>> http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix & Windows
>> Those who would give up essential Liberty, to purchase a little temporary
>> Safety, deserve neither Liberty nor Safety.
>>     -- Benjamin Franklin
>> "carpe diem quam minimum credula postero"
>>
>
>
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of DataStax, the source for professional Cassandra support
> http://www.datastax.com
>



-- 
Aaron Turner
http://synfin.net/         Twitter: @synfinatic
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix & Windows
Those who would give up essential Liberty, to purchase a little temporary
Safety, deserve neither Liberty nor Safety.
    -- Benjamin Franklin
"carpe diem quam minimum credula postero"

Re: CQL + Counters = bad request

Posted by Jonathan Ellis <jb...@gmail.com>.
Try quoting the column name.

On Tue, Jul 12, 2011 at 5:30 PM, Aaron Turner <sy...@gmail.com> wrote:
> Using Cassandra 0.8.1 and cql 1.0.3 and following the syntax mentioned
> in https://issues.apache.org/jira/browse/CASSANDRA-2473
>
> cqlsh> UPDATE RouterAggWeekly SET 1310367600 = 1310367600 + 17 WHERE
> KEY = '1_20110728_ifoutmulticastpkts';
> Bad Request: line 1:51 no viable alternative at character '+'
>
> Column names are Long's, hence the INT = INT + INT
>
> Ideas?
>
> --
> Aaron Turner
> http://synfin.net/         Twitter: @synfinatic
> http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix & Windows
> Those who would give up essential Liberty, to purchase a little temporary
> Safety, deserve neither Liberty nor Safety.
>     -- Benjamin Franklin
> "carpe diem quam minimum credula postero"
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of DataStax, the source for professional Cassandra support
http://www.datastax.com