You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "pavel (JIRA)" <ji...@apache.org> on 2017/03/02 08:59:45 UTC
[jira] [Updated] (CASSANDRA-13286) Using secondary indexes to
update rows
[ https://issues.apache.org/jira/browse/CASSANDRA-13286?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
pavel updated CASSANDRA-13286:
------------------------------
Priority: Minor (was: Major)
> Using secondary indexes to update rows
> --------------------------------------
>
> Key: CASSANDRA-13286
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13286
> Project: Cassandra
> Issue Type: Wish
> Components: CQL
> Reporter: pavel
> Priority: Minor
>
> You cannot perform an UPSERT in Cassandra without specifying the complete PRIMARY KEY. Even UPSERTs with a partial PRIMARY KEY will not work. And UPSERTing by an indexed value does not work, either.
> Using secondary indexes to update rows can be a very useful feature even with performance drawbacks.
> As described here:
> http://stackoverflow.com/questions/30168264/using-secondary-indexes-to-update-rows-in-cassandra-2-1
> Query:
> UPDATE events SET ticket_id = 321 WHERE ticket_id = 123;
> Will cause the error:
> InvalidRequest: code=2200 [Invalid query] message="Non PRIMARY KEY ticket_id found in where clause"
> Schema:
> CREATE TABLE events (
> client_id bigint,
> bucket int,
> timestamp timeuuid,
> ...
> ticket_id bigint,
> PRIMARY KEY ((client_id, bucket), timestamp)
> );
> CREATE INDEX events_ticket ON events(ticket_id);
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)