You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Sylvain Lebresne (JIRA)" <ji...@apache.org> on 2014/08/12 10:21:11 UTC

[jira] [Updated] (CASSANDRA-7747) CQL token(id) does not work in DELETE statements

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

Sylvain Lebresne updated CASSANDRA-7747:
----------------------------------------

    Attachment: 7747.txt

The error message is clearly wrong: the {{token}} function happens to be mistakenly ignored by the code, hence the error message (the code is interpreted as {{id = 0x478e5222f7484a5596344392e4451d59}} and I suspect {{id}} is a uuid in your table definition, hence the type mismatch). But really, we don't support deletion (or update) by token (as in, the code is not able to handle it, and I don't think the ability is worth the complexity that it would add) and so attaching a patch that simply fix the error message.

> CQL token(id) does not work in DELETE statements
> ------------------------------------------------
>
>                 Key: CASSANDRA-7747
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7747
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>         Environment: CQL on CentOS 7 and Arch Linux, Cassandra 2.0.9
>            Reporter: Taylor Gronka
>            Priority: Minor
>             Fix For: 2.0.10
>
>         Attachments: 7747.txt
>
>
> When I try to delete a row by the token of the primary key, this happens:
> cqlsh> delete from keyspace.table where token(id) = 0x478e5222f7484a5596344392e4451d59;
> Bad Request: Invalid HEX constant (0x478e5222f7484a5596344392e4451d59) for id of type uuid
> I'm using a blob-type because my data is highly organized, so I'm running a ByteOrderedPartitioner. This isn't a major issue, but it will save me a bit of coding hassle and cpu cycles to not be converting in and out of uuid's.
> Also, I find it curious that the ByteOrderedPartitioner stores values as blob, but returns them as uuid - although I imagine this discussion took place long before I got here. Might there be a way to set Cassandra to deal solely with blobs? Or at least to return a uuid as blob?



--
This message was sent by Atlassian JIRA
(v6.2#6252)