You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Lex Lythius (JIRA)" <ji...@apache.org> on 2015/09/07 18:10:45 UTC
[jira] [Comment Edited] (CASSANDRA-10279) Inconsistent
update/delete behavior for static lists vs lists
[ https://issues.apache.org/jira/browse/CASSANDRA-10279?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14733873#comment-14733873 ]
Lex Lythius edited comment on CASSANDRA-10279 at 9/7/15 4:10 PM:
-----------------------------------------------------------------
Most likely the underlying issue is the same as in https://issues.apache.org/jira/browse/CASSANDRA-9838. Removing elements by setting to null doesn't work either:
{code:sql}
update t_lists set sls[0]=null where id=1;
InvalidRequest: code=2200 [Invalid query] message="Attempted to set an element on a list which is null"
{code}
Said bug entry shows there's a patch available, due to be fixed at 2.1.x. Not fixed in 2.2.0, however.
was (Author: lexlythius):
Maybe the underlying issue is the same as in https://issues.apache.org/jira/browse/CASSANDRA-9838.
> Inconsistent update/delete behavior for static lists vs lists
> -------------------------------------------------------------
>
> Key: CASSANDRA-10279
> URL: https://issues.apache.org/jira/browse/CASSANDRA-10279
> Project: Cassandra
> Issue Type: Bug
> Components: Core
> Environment: [cqlsh 5.0.1 | Cassandra 2.2.0 | CQL spec 3.3.0 | Native protocol v4]
> Ubuntu 14.04 x64
> Reporter: Lex Lythius
>
> Partial list deletions (either in the form of {{UPDATE list = list - \[...]}} or {{DELETE list\[index]}} form) work fine in regular list columns, but do nothing or throw bad index error when applied to *static* list columns.
> Example:
> {code:sql}
> create table t_lists (
> id int,
> dt int,
> ls list<ascii>,
> sls list<ascii> static,
> primary key(id, dt)
> );
> cqlsh:test> update t_lists set ls = ['foo', 'bar', 'baz'], sls = ['chico', 'harpo', 'zeppo', 'groucho'] where id=1 and dt=1;
> cqlsh:test> select * from t_lists;
> id | dt | sls | ls
> ----+----+----------------------------------------+-----------------------
> 1 | 1 | ['chico', 'harpo', 'zeppo', 'groucho'] | ['foo', 'bar', 'baz']
> (1 rows)
> cqlsh:test> delete ls[2] from t_lists where id = 1 and dt = 1; -- works
> cqlsh:test> delete sls[2] from t_lists where id = 1; -- errors
> InvalidRequest: code=2200 [Invalid query] message="Attempted to delete an element from a list which is null"
> cqlsh:test> select * from t_lists;
> id | dt | sls | ls
> ----+----+----------------------------------------+----------------
> 1 | 1 | ['chico', 'harpo', 'zeppo', 'groucho'] | ['foo', 'bar']
> (1 rows)
> cqlsh:test> update t_lists set ls = ls - ['bar'] where id=1 and dt=1; -- works
> cqlsh:test> update t_lists set sls = sls - ['zeppo'] where id=1; -- fails silently
> cqlsh:test> select * from t_lists;
> id | dt | sls | ls
> ----+----+----------------------------------------+---------
> 1 | 1 | ['chico', 'harpo', 'zeppo', 'groucho'] | ['foo']
> (1 rows)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)