cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Ellis (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CASSANDRA-9395) Prohibit Counter type as part of the PK
Date Fri, 15 May 2015 16:29:01 GMT

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

Jonathan Ellis updated CASSANDRA-9395:
--------------------------------------
    Fix Version/s:     (was: 2.2 rc1)
                   2.2.x

> Prohibit Counter type as part of the PK
> ---------------------------------------
>
>                 Key: CASSANDRA-9395
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-9395
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Sebastian Estevez
>            Assignee: Tyler Hobbs
>             Fix For: 2.1.x, 2.0.x, 2.2.x
>
>
> C* let me do this:
> {code}
> create table aggregated.counter1 ( a counter , b int , PRIMARY KEY (b,a)) WITH CLUSTERING
ORDER BY (a desc);
> {code}
> and then treated a as an int!
> {code}
> cqlsh> update aggregated.counter1 set a= a+1 where b = 2 ;Bad Request: Invalid operation
(a = a + 1) for non counter column a
> {code}
> {code}
> insert INTO aggregated.counter1 (b, a ) VALUES ( 3, 2) ;
> {code}
> (should have given can't insert must update error)
> Even though desc table still shows it as a counter type:
> {code}
> CREATE TABLE counter1 (
>   b int,
>   a counter,
>   PRIMARY KEY ((b), a)
> ) WITH CLUSTERING ORDER BY (a DESC) AND
>   bloom_filter_fp_chance=0.010000 AND
>   caching='KEYS_ONLY' AND
>   comment='' AND
>   dclocal_read_repair_chance=0.100000 AND
>   gc_grace_seconds=864000 AND
>   index_interval=128 AND
>   read_repair_chance=0.000000 AND
>   replicate_on_write='true' AND
>   populate_io_cache_on_flush='false' AND
>   default_time_to_live=0 AND
>   speculative_retry='99.0PERCENTILE' AND
>   memtable_flush_period_in_ms=0 AND
>   compaction={'class': 'SizeTieredCompactionStrategy'} AND
>   compression={'sstable_compression': 'LZ4Compressor'};
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message