cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gábor Auth (JIRA) <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-10910) Materialized view remained rows
Date Tue, 22 Dec 2015 07:59:46 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-10910?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15067716#comment-15067716
] 

Gábor Auth commented on CASSANDRA-10910:
----------------------------------------

Another test case about the issue:
{code}
> create table test (id text primary key, key text, value int);
> create MATERIALIZED VIEW test_by_key as SELECT * from test where key is not null primary
key (key, id);
> update test set key='key', value=1 where id='id';
> select * from test; select * from test_by_key ;

 id | key | value
----+-----+-------
 id | key |     1

(1 rows)

 key | id | value
-----+----+-------
 key | id |     1

(1 rows)
> update test set value=2 where id='id';
> select * from test; select * from test_by_key ;

 id | key | value
----+-----+-------
 id | key |     2

(1 rows)

 key | id | value
-----+----+-------
 key | id |     2

(1 rows)
> update test set key=null where id='id';
> select * from test; select * from test_by_key ;

 id | key  | value
----+------+-------
 id | null |     2

(1 rows)

 key | id | value
-----+----+-------
     | id |     2
 key | id |     2

(2 rows)
> delete from test where id='id';
> select * from test; select * from test_by_key ;

 id | key | value
----+-----+-------

(0 rows)

 key | id | value
-----+----+-------
     | id |     2
 key | id |     2

(2 rows)
{code}

> Materialized view remained rows
> -------------------------------
>
>                 Key: CASSANDRA-10910
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-10910
>             Project: Cassandra
>          Issue Type: Bug
>         Environment: Cassandra 3.0.0
>            Reporter: Gábor Auth
>            Assignee: Carl Yeksigian
>
> I've created a table and a materialized view.
> {code}
> > CREATE TABLE test (id text PRIMARY KEY, key text, value int);
> > CREATE MATERIALIZED VIEW test_view AS SELECT * FROM test WHERE key IS NOT NULL PRIMARY
KEY(key, id);
> {code}
> I've put a value into the table:
> {code}
> > update test set key='key', value=1 where id='id';
> > select * from test; select * from test_view ;
>  id | key | value
> ----+-----+-------
>  id | key |     1
> (1 rows)
>  key | id | value
> -----+----+-------
>  key | id |     1
> (1 rows)
> {code}
> I've updated the value without specified the key of the materialized view:
> {code}
> > update test set value=2 where id='id';
> > select * from test; select * from test_view ;
>  id | key | value
> ----+-----+-------
>  id | key |     2
> (1 rows)
>  key | id | value
> -----+----+-------
>  key | id |     2
> (1 rows)
> {code}
> It works as I think...
> ...but I've updated the key of the materialized view:
> {code}
> > update test set key='newKey' where id='id';
> > select * from test; select * from test_view ;
>  id | key    | value
> ----+--------+-------
>  id | newKey |     2
> (1 rows)
>  key    | id | value
> --------+----+-------
>     key | id |     2
>  newKey | id |     2
> (2 rows)
> {code}
> ...I've updated the value of the row:
> {code}
> > update test set key='newKey', value=3 where id='id';
> > select * from test; select * from test_view ;
>  id | key    | value
> ----+--------+-------
>  id | newKey |     3
> (1 rows)
>  key    | id | value
> --------+----+-------
>     key | id |     2
>  newKey | id |     3
> (2 rows)
> {code}
> ...I've deleted the row by the id key:
> {code}
> > delete from test where id='id';
> > select * from test; select * from test_view ;
>  id | key | value
> ----+-----+-------
> (0 rows)
>  key | id | value
> -----+----+-------
>  key | id |     2
> (1 rows)
> {code}
> Is it a bug?



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

Mime
View raw message