You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Katsutoshi <na...@gmail.com> on 2014/02/18 11:54:09 UTC

paging state will not work

Hi.

I am using Cassandra 2.0.5 version. If null is explicitly set to a column,
paging_state will not work. My test procedure is as follows:

------
create a table and insert 10 records using cqlsh. the query is as follows:

    cqlsh:test> CREATE TABLE mytable (id int, range int, value text,
PRIMARY KEY (id, range));
    cqlsh:test> INSERT INTO mytable (id, range) VALUES (0, 0);
    cqlsh:test> INSERT INTO mytable (id, range) VALUES (0, 1);
    cqlsh:test> INSERT INTO mytable (id, range) VALUES (0, 2);
    cqlsh:test> INSERT INTO mytable (id, range) VALUES (0, 3);
    cqlsh:test> INSERT INTO mytable (id, range) VALUES (0, 4);
    cqlsh:test> INSERT INTO mytable (id, range, value) VALUES (0, 5, null);
    cqlsh:test> INSERT INTO mytable (id, range, value) VALUES (0, 6, null);
    cqlsh:test> INSERT INTO mytable (id, range, value) VALUES (0, 7, null);
    cqlsh:test> INSERT INTO mytable (id, range, value) VALUES (0, 8, null);
    cqlsh:test> INSERT INTO mytable (id, range, value) VALUES (0, 9, null);

select data using datastax driver. the pseudocode is as follows:

    Statement statement =
QueryBuilder.select().from("mytable").setFetchSize(1);
    ResultSet rs = session.execute(statement);
    for(Row row : rs){
        System.out.println(String.format("id=%s, range=%s, value=%s",
            row.getInt("id"), row.getInt("range"), row.getString("value")));
    }

the result is as follows:

    id=0, range=0, value=null
    id=0, range=1, value=null
    id=0, range=2, value=null
    id=0, range=3, value=null
    id=0, range=4, value=null
    id=0, range=5, value=null
    id=0, range=7, value=null
    id=0, range=9, value=null
------

Result is 8 records although 10 records were expected. Does anyone has a
similar issue?

Thanks,
Katsutoshi

Re: paging state will not work

Posted by Katsutoshi <na...@gmail.com>.
Thank you for the reply. Added:
https://issues.apache.org/jira/browse/CASSANDRA-6748

Katsutoshi


2014-02-21 2:14 GMT+09:00 Sylvain Lebresne <sy...@datastax.com>:

> That does sound like a bug. Would you mind opening a JIRA (
> https://issues.apache.org/jira/browse/CASSANDRA) ticket for it?
>
>
> On Thu, Feb 20, 2014 at 3:06 PM, Edward Capriolo <ed...@gmail.com>wrote:
>
>> I would try a fetch size other then 1. Cassandras slices are start
>> inclusive so maybe that is a bug.
>>
>>
>> On Tuesday, February 18, 2014, Katsutoshi <na...@gmail.com> wrote:
>> > Hi.
>> >
>> > I am using Cassandra 2.0.5 version. If null is explicitly set to a
>> column, paging_state will not work. My test procedure is as follows:
>> >
>> > ------
>> > create a table and insert 10 records using cqlsh. the query is as
>> follows:
>> >
>> >     cqlsh:test> CREATE TABLE mytable (id int, range int, value text,
>> PRIMARY KEY (id, range));
>> >     cqlsh:test> INSERT INTO mytable (id, range) VALUES (0, 0);
>> >     cqlsh:test> INSERT INTO mytable (id, range) VALUES (0, 1);
>> >     cqlsh:test> INSERT INTO mytable (id, range) VALUES (0, 2);
>> >     cqlsh:test> INSERT INTO mytable (id, range) VALUES (0, 3);
>> >     cqlsh:test> INSERT INTO mytable (id, range) VALUES (0, 4);
>> >     cqlsh:test> INSERT INTO mytable (id, range, value) VALUES (0, 5,
>> null);
>> >     cqlsh:test> INSERT INTO mytable (id, range, value) VALUES (0, 6,
>> null);
>> >     cqlsh:test> INSERT INTO mytable (id, range, value) VALUES (0, 7,
>> null);
>> >     cqlsh:test> INSERT INTO mytable (id, range, value) VALUES (0, 8,
>> null);
>> >     cqlsh:test> INSERT INTO mytable (id, range, value) VALUES (0, 9,
>> null);
>> >
>> > select data using datastax driver. the pseudocode is as follows:
>> >
>> >     Statement statement =
>> QueryBuilder.select().from("mytable").setFetchSize(1);
>> >     ResultSet rs = session.execute(statement);
>> >     for(Row row : rs){
>> >         System.out.println(String.format("id=%s, range=%s, value=%s",
>> >             row.getInt("id"), row.getInt("range"),
>> row.getString("value")));
>> >     }
>> >
>> > the result is as follows:
>> >
>> >     id=0, range=0, value=null
>> >     id=0, range=1, value=null
>> >     id=0, range=2, value=null
>> >     id=0, range=3, value=null
>> >     id=0, range=4, value=null
>> >     id=0, range=5, value=null
>> >     id=0, range=7, value=null
>> >     id=0, range=9, value=null
>> > ------
>> >
>> > Result is 8 records although 10 records were expected. Does anyone has
>> a similar issue?
>> >
>> > Thanks,
>> > Katsutoshi
>> >
>>
>> --
>> Sorry this was sent from mobile. Will do less grammar and spell check
>> than usual.
>>
>
>

Re: paging state will not work

Posted by Sylvain Lebresne <sy...@datastax.com>.
That does sound like a bug. Would you mind opening a JIRA (
https://issues.apache.org/jira/browse/CASSANDRA) ticket for it?


On Thu, Feb 20, 2014 at 3:06 PM, Edward Capriolo <ed...@gmail.com>wrote:

> I would try a fetch size other then 1. Cassandras slices are start
> inclusive so maybe that is a bug.
>
>
> On Tuesday, February 18, 2014, Katsutoshi <na...@gmail.com> wrote:
> > Hi.
> >
> > I am using Cassandra 2.0.5 version. If null is explicitly set to a
> column, paging_state will not work. My test procedure is as follows:
> >
> > ------
> > create a table and insert 10 records using cqlsh. the query is as
> follows:
> >
> >     cqlsh:test> CREATE TABLE mytable (id int, range int, value text,
> PRIMARY KEY (id, range));
> >     cqlsh:test> INSERT INTO mytable (id, range) VALUES (0, 0);
> >     cqlsh:test> INSERT INTO mytable (id, range) VALUES (0, 1);
> >     cqlsh:test> INSERT INTO mytable (id, range) VALUES (0, 2);
> >     cqlsh:test> INSERT INTO mytable (id, range) VALUES (0, 3);
> >     cqlsh:test> INSERT INTO mytable (id, range) VALUES (0, 4);
> >     cqlsh:test> INSERT INTO mytable (id, range, value) VALUES (0, 5,
> null);
> >     cqlsh:test> INSERT INTO mytable (id, range, value) VALUES (0, 6,
> null);
> >     cqlsh:test> INSERT INTO mytable (id, range, value) VALUES (0, 7,
> null);
> >     cqlsh:test> INSERT INTO mytable (id, range, value) VALUES (0, 8,
> null);
> >     cqlsh:test> INSERT INTO mytable (id, range, value) VALUES (0, 9,
> null);
> >
> > select data using datastax driver. the pseudocode is as follows:
> >
> >     Statement statement =
> QueryBuilder.select().from("mytable").setFetchSize(1);
> >     ResultSet rs = session.execute(statement);
> >     for(Row row : rs){
> >         System.out.println(String.format("id=%s, range=%s, value=%s",
> >             row.getInt("id"), row.getInt("range"),
> row.getString("value")));
> >     }
> >
> > the result is as follows:
> >
> >     id=0, range=0, value=null
> >     id=0, range=1, value=null
> >     id=0, range=2, value=null
> >     id=0, range=3, value=null
> >     id=0, range=4, value=null
> >     id=0, range=5, value=null
> >     id=0, range=7, value=null
> >     id=0, range=9, value=null
> > ------
> >
> > Result is 8 records although 10 records were expected. Does anyone has a
> similar issue?
> >
> > Thanks,
> > Katsutoshi
> >
>
> --
> Sorry this was sent from mobile. Will do less grammar and spell check than
> usual.
>

Re: paging state will not work

Posted by Edward Capriolo <ed...@gmail.com>.
I would try a fetch size other then 1. Cassandras slices are start
inclusive so maybe that is a bug.

On Tuesday, February 18, 2014, Katsutoshi <na...@gmail.com> wrote:
> Hi.
>
> I am using Cassandra 2.0.5 version. If null is explicitly set to a
column, paging_state will not work. My test procedure is as follows:
>
> ------
> create a table and insert 10 records using cqlsh. the query is as follows:
>
>     cqlsh:test> CREATE TABLE mytable (id int, range int, value text,
PRIMARY KEY (id, range));
>     cqlsh:test> INSERT INTO mytable (id, range) VALUES (0, 0);
>     cqlsh:test> INSERT INTO mytable (id, range) VALUES (0, 1);
>     cqlsh:test> INSERT INTO mytable (id, range) VALUES (0, 2);
>     cqlsh:test> INSERT INTO mytable (id, range) VALUES (0, 3);
>     cqlsh:test> INSERT INTO mytable (id, range) VALUES (0, 4);
>     cqlsh:test> INSERT INTO mytable (id, range, value) VALUES (0, 5,
null);
>     cqlsh:test> INSERT INTO mytable (id, range, value) VALUES (0, 6,
null);
>     cqlsh:test> INSERT INTO mytable (id, range, value) VALUES (0, 7,
null);
>     cqlsh:test> INSERT INTO mytable (id, range, value) VALUES (0, 8,
null);
>     cqlsh:test> INSERT INTO mytable (id, range, value) VALUES (0, 9,
null);
>
> select data using datastax driver. the pseudocode is as follows:
>
>     Statement statement =
QueryBuilder.select().from("mytable").setFetchSize(1);
>     ResultSet rs = session.execute(statement);
>     for(Row row : rs){
>         System.out.println(String.format("id=%s, range=%s, value=%s",
>             row.getInt("id"), row.getInt("range"),
row.getString("value")));
>     }
>
> the result is as follows:
>
>     id=0, range=0, value=null
>     id=0, range=1, value=null
>     id=0, range=2, value=null
>     id=0, range=3, value=null
>     id=0, range=4, value=null
>     id=0, range=5, value=null
>     id=0, range=7, value=null
>     id=0, range=9, value=null
> ------
>
> Result is 8 records although 10 records were expected. Does anyone has a
similar issue?
>
> Thanks,
> Katsutoshi
>

-- 
Sorry this was sent from mobile. Will do less grammar and spell check than
usual.

Re: paging state will not work

Posted by Edward Capriolo <ed...@gmail.com>.
Cassandra has no null. So in this context setting a column to null or
updating null is a delete. I think. I remember debating the semantics of
null once.

On Tuesday, February 18, 2014, Katsutoshi <na...@gmail.com> wrote:
> Hi.
>
> I am using Cassandra 2.0.5 version. If null is explicitly set to a
column, paging_state will not work. My test procedure is as follows:
>
> ------
> create a table and insert 10 records using cqlsh. the query is as follows:
>
>     cqlsh:test> CREATE TABLE mytable (id int, range int, value text,
PRIMARY KEY (id, range));
>     cqlsh:test> INSERT INTO mytable (id, range) VALUES (0, 0);
>     cqlsh:test> INSERT INTO mytable (id, range) VALUES (0, 1);
>     cqlsh:test> INSERT INTO mytable (id, range) VALUES (0, 2);
>     cqlsh:test> INSERT INTO mytable (id, range) VALUES (0, 3);
>     cqlsh:test> INSERT INTO mytable (id, range) VALUES (0, 4);
>     cqlsh:test> INSERT INTO mytable (id, range, value) VALUES (0, 5,
null);
>     cqlsh:test> INSERT INTO mytable (id, range, value) VALUES (0, 6,
null);
>     cqlsh:test> INSERT INTO mytable (id, range, value) VALUES (0, 7,
null);
>     cqlsh:test> INSERT INTO mytable (id, range, value) VALUES (0, 8,
null);
>     cqlsh:test> INSERT INTO mytable (id, range, value) VALUES (0, 9,
null);
>
> select data using datastax driver. the pseudocode is as follows:
>
>     Statement statement =
QueryBuilder.select().from("mytable").setFetchSize(1);
>     ResultSet rs = session.execute(statement);
>     for(Row row : rs){
>         System.out.println(String.format("id=%s, range=%s, value=%s",
>             row.getInt("id"), row.getInt("range"),
row.getString("value")));
>     }
>
> the result is as follows:
>
>     id=0, range=0, value=null
>     id=0, range=1, value=null
>     id=0, range=2, value=null
>     id=0, range=3, value=null
>     id=0, range=4, value=null
>     id=0, range=5, value=null
>     id=0, range=7, value=null
>     id=0, range=9, value=null
> ------
>
> Result is 8 records although 10 records were expected. Does anyone has a
similar issue?
>
> Thanks,
> Katsutoshi
>

-- 
Sorry this was sent from mobile. Will do less grammar and spell check than
usual.