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

Sylvain Lebresne updated CASSANDRA-2321:
----------------------------------------

    Attachment: 0001-Don-t-allow-normal-query-on-counter-CF.patch

Actually, having getString() return hexString is the right thing to do, because 
internally counters are bytes and getString is used by sstable2json in 
particular.

The problem however is that it is not disallowed to query a counter CF with 
non-counter operation. Attaching a patch to correct this. This is a bigger 
patch that one would hope because ThriftValidation doesn't help. So the patch 
does a bunch of refactoring to allow what it must do. As a side node, the 
refactoring makes it more efficient (We don't revalidate the column family for 
each mutation of a batch_mutate).

Btw, stress.py has no support for counters, but stress.java has it. 

> Counter column values shows in hex values. Need to show it in string value.
> ---------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2321
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2321
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 0.8
>         Environment: Linux
>            Reporter: Mubarak Seyed
>            Assignee: Sylvain Lebresne
>            Priority: Minor
>             Fix For: 0.8
>
>         Attachments: 0001-Don-t-allow-normal-query-on-counter-CF.patch
>
>
> CounterColumnType.getString() returns hexString.
> {code}
> public String getString(ByteBuffer bytes)
> { 
>        return ByteBufferUtil.bytesToHex(bytes);
> }
> {code}
> and python stress.py reader returns
> [ColumnOrSuperColumn(column=None, super_column=SuperColumn(name='19', 
> columns=[Column(timestamp=1299984960277, name='56', 
> value='\x7f\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00,',
>  ttl=None), Column(timestamp=1299985019923, name='57', 
> value='\x7f\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00;\x00\x00\x00\x00\x00\x00\x08\xfd',
>  ttl=None))]

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to