You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Kevin Burton <bu...@spinn3r.com> on 2014/06/06 07:22:41 UTC

Bad Request: Type error: cannot assign result of function token (type bigint) to id (type int)

I'm building a new schema which I need to read externally by paging through
the result set.

My understanding from reading the documentation , and this list, is that I
can do that but I need to use the token() function.

Only it doesn't work.

Here's a reduction:


create table test_paging (
id int,
primary key(id)
);

insert into test_paging (id) values (1);
insert into test_paging (id) values (2);
insert into test_paging (id) values (3);
insert into test_paging (id) values (4);
insert into test_paging (id) values (5);

select * from test_paging where id > token(0);

… but it gives me:

Bad Request: Type error: cannot assign result of function token (type
bigint) to id (type int)

…

What's that about?  I can't find any documentation for this and there
aren't any concise examples.


-- 

Founder/CEO Spinn3r.com
Location: *San Francisco, CA*
Skype: *burtonator*
blog: http://burtonator.wordpress.com
… or check out my Google+ profile
<https://plus.google.com/102718274791889610666/posts>
<http://spinn3r.com>
War is peace. Freedom is slavery. Ignorance is strength. Corporations are
people.

Re: Bad Request: Type error: cannot assign result of function token (type bigint) to id (type int)

Posted by Kevin Burton <bu...@spinn3r.com>.
Thanks!! Yes. I completely missed that.  Not sure why… :)

Appreciate the help!


On Fri, Jun 6, 2014 at 2:59 AM, Laing, Michael <mi...@nytimes.com>
wrote:

> select * from test_paging where *token(*id*)* > token(0);
>
> ml
>
>
> On Fri, Jun 6, 2014 at 1:47 AM, Jonathan Haddad <jo...@jonhaddad.com> wrote:
>
>> Sorry, the datastax docs are actually a bit better:
>> http://www.datastax.com/documentation/cql/3.0/cql/cql_using/paging_c.html
>>
>> Jon
>>
>>
>> On Thu, Jun 5, 2014 at 10:46 PM, Jonathan Haddad <jo...@jonhaddad.com>
>> wrote:
>>
>>> You should read through the token docs, it has examples and
>>> specifications: http://cassandra.apache.org/doc/cql3/CQL.html#tokenFun
>>>
>>>
>>> On Thu, Jun 5, 2014 at 10:22 PM, Kevin Burton <bu...@spinn3r.com>
>>> wrote:
>>>
>>>> I'm building a new schema which I need to read externally by paging
>>>> through the result set.
>>>>
>>>> My understanding from reading the documentation , and this list, is
>>>> that I can do that but I need to use the token() function.
>>>>
>>>> Only it doesn't work.
>>>>
>>>> Here's a reduction:
>>>>
>>>>
>>>> create table test_paging (
>>>> id int,
>>>> primary key(id)
>>>> );
>>>>
>>>> insert into test_paging (id) values (1);
>>>> insert into test_paging (id) values (2);
>>>> insert into test_paging (id) values (3);
>>>> insert into test_paging (id) values (4);
>>>> insert into test_paging (id) values (5);
>>>>
>>>> select * from test_paging where id > token(0);
>>>>
>>>> … but it gives me:
>>>>
>>>> Bad Request: Type error: cannot assign result of function token (type
>>>> bigint) to id (type int)
>>>>
>>>> …
>>>>
>>>> What's that about?  I can't find any documentation for this and there
>>>> aren't any concise examples.
>>>>
>>>>
>>>> --
>>>>
>>>> Founder/CEO Spinn3r.com
>>>> Location: *San Francisco, CA*
>>>> Skype: *burtonator*
>>>> blog: http://burtonator.wordpress.com
>>>> … or check out my Google+ profile
>>>> <https://plus.google.com/102718274791889610666/posts>
>>>> <http://spinn3r.com>
>>>> War is peace. Freedom is slavery. Ignorance is strength. Corporations
>>>> are people.
>>>>
>>>>
>>>
>>>
>>> --
>>> Jon Haddad
>>> http://www.rustyrazorblade.com
>>> skype: rustyrazorblade
>>>
>>
>>
>>
>> --
>> Jon Haddad
>> http://www.rustyrazorblade.com
>> skype: rustyrazorblade
>>
>
>


-- 

Founder/CEO Spinn3r.com
Location: *San Francisco, CA*
Skype: *burtonator*
blog: http://burtonator.wordpress.com
… or check out my Google+ profile
<https://plus.google.com/102718274791889610666/posts>
<http://spinn3r.com>
War is peace. Freedom is slavery. Ignorance is strength. Corporations are
people.

Re: Bad Request: Type error: cannot assign result of function token (type bigint) to id (type int)

Posted by "Laing, Michael" <mi...@nytimes.com>.
select * from test_paging where *token(*id*)* > token(0);

ml


On Fri, Jun 6, 2014 at 1:47 AM, Jonathan Haddad <jo...@jonhaddad.com> wrote:

> Sorry, the datastax docs are actually a bit better:
> http://www.datastax.com/documentation/cql/3.0/cql/cql_using/paging_c.html
>
> Jon
>
>
> On Thu, Jun 5, 2014 at 10:46 PM, Jonathan Haddad <jo...@jonhaddad.com>
> wrote:
>
>> You should read through the token docs, it has examples and
>> specifications: http://cassandra.apache.org/doc/cql3/CQL.html#tokenFun
>>
>>
>> On Thu, Jun 5, 2014 at 10:22 PM, Kevin Burton <bu...@spinn3r.com> wrote:
>>
>>> I'm building a new schema which I need to read externally by paging
>>> through the result set.
>>>
>>> My understanding from reading the documentation , and this list, is that
>>> I can do that but I need to use the token() function.
>>>
>>> Only it doesn't work.
>>>
>>> Here's a reduction:
>>>
>>>
>>> create table test_paging (
>>> id int,
>>> primary key(id)
>>> );
>>>
>>> insert into test_paging (id) values (1);
>>> insert into test_paging (id) values (2);
>>> insert into test_paging (id) values (3);
>>> insert into test_paging (id) values (4);
>>> insert into test_paging (id) values (5);
>>>
>>> select * from test_paging where id > token(0);
>>>
>>> … but it gives me:
>>>
>>> Bad Request: Type error: cannot assign result of function token (type
>>> bigint) to id (type int)
>>>
>>> …
>>>
>>> What's that about?  I can't find any documentation for this and there
>>> aren't any concise examples.
>>>
>>>
>>> --
>>>
>>> Founder/CEO Spinn3r.com
>>> Location: *San Francisco, CA*
>>> Skype: *burtonator*
>>> blog: http://burtonator.wordpress.com
>>> … or check out my Google+ profile
>>> <https://plus.google.com/102718274791889610666/posts>
>>> <http://spinn3r.com>
>>> War is peace. Freedom is slavery. Ignorance is strength. Corporations
>>> are people.
>>>
>>>
>>
>>
>> --
>> Jon Haddad
>> http://www.rustyrazorblade.com
>> skype: rustyrazorblade
>>
>
>
>
> --
> Jon Haddad
> http://www.rustyrazorblade.com
> skype: rustyrazorblade
>

Re: Bad Request: Type error: cannot assign result of function token (type bigint) to id (type int)

Posted by Jonathan Haddad <jo...@jonhaddad.com>.
Sorry, the datastax docs are actually a bit better:
http://www.datastax.com/documentation/cql/3.0/cql/cql_using/paging_c.html

Jon


On Thu, Jun 5, 2014 at 10:46 PM, Jonathan Haddad <jo...@jonhaddad.com> wrote:

> You should read through the token docs, it has examples and
> specifications: http://cassandra.apache.org/doc/cql3/CQL.html#tokenFun
>
>
> On Thu, Jun 5, 2014 at 10:22 PM, Kevin Burton <bu...@spinn3r.com> wrote:
>
>> I'm building a new schema which I need to read externally by paging
>> through the result set.
>>
>> My understanding from reading the documentation , and this list, is that
>> I can do that but I need to use the token() function.
>>
>> Only it doesn't work.
>>
>> Here's a reduction:
>>
>>
>> create table test_paging (
>> id int,
>> primary key(id)
>> );
>>
>> insert into test_paging (id) values (1);
>> insert into test_paging (id) values (2);
>> insert into test_paging (id) values (3);
>> insert into test_paging (id) values (4);
>> insert into test_paging (id) values (5);
>>
>> select * from test_paging where id > token(0);
>>
>> … but it gives me:
>>
>> Bad Request: Type error: cannot assign result of function token (type
>> bigint) to id (type int)
>>
>> …
>>
>> What's that about?  I can't find any documentation for this and there
>> aren't any concise examples.
>>
>>
>> --
>>
>> Founder/CEO Spinn3r.com
>> Location: *San Francisco, CA*
>> Skype: *burtonator*
>> blog: http://burtonator.wordpress.com
>> … or check out my Google+ profile
>> <https://plus.google.com/102718274791889610666/posts>
>> <http://spinn3r.com>
>> War is peace. Freedom is slavery. Ignorance is strength. Corporations are
>> people.
>>
>>
>
>
> --
> Jon Haddad
> http://www.rustyrazorblade.com
> skype: rustyrazorblade
>



-- 
Jon Haddad
http://www.rustyrazorblade.com
skype: rustyrazorblade

Re: Bad Request: Type error: cannot assign result of function token (type bigint) to id (type int)

Posted by Jonathan Haddad <jo...@jonhaddad.com>.
You should read through the token docs, it has examples and specifications:
http://cassandra.apache.org/doc/cql3/CQL.html#tokenFun


On Thu, Jun 5, 2014 at 10:22 PM, Kevin Burton <bu...@spinn3r.com> wrote:

> I'm building a new schema which I need to read externally by paging
> through the result set.
>
> My understanding from reading the documentation , and this list, is that I
> can do that but I need to use the token() function.
>
> Only it doesn't work.
>
> Here's a reduction:
>
>
> create table test_paging (
> id int,
> primary key(id)
> );
>
> insert into test_paging (id) values (1);
> insert into test_paging (id) values (2);
> insert into test_paging (id) values (3);
> insert into test_paging (id) values (4);
> insert into test_paging (id) values (5);
>
> select * from test_paging where id > token(0);
>
> … but it gives me:
>
> Bad Request: Type error: cannot assign result of function token (type
> bigint) to id (type int)
>
> …
>
> What's that about?  I can't find any documentation for this and there
> aren't any concise examples.
>
>
> --
>
> Founder/CEO Spinn3r.com
> Location: *San Francisco, CA*
> Skype: *burtonator*
> blog: http://burtonator.wordpress.com
> … or check out my Google+ profile
> <https://plus.google.com/102718274791889610666/posts>
> <http://spinn3r.com>
> War is peace. Freedom is slavery. Ignorance is strength. Corporations are
> people.
>
>


-- 
Jon Haddad
http://www.rustyrazorblade.com
skype: rustyrazorblade

Re: Bad Request: Type error: cannot assign result of function token (type bigint) to id (type int)

Posted by Jack Krupansky <ja...@basetechnology.com>.
The message does seem a little odd in that it refers to “assign”, but it would make more sense to say “compare”.

-- Jack Krupansky

From: Kevin Burton 
Sent: Friday, June 6, 2014 1:22 AM
To: user@cassandra.apache.org 
Subject: Bad Request: Type error: cannot assign result of function token (type bigint) to id (type int)

I'm building a new schema which I need to read externally by paging through the result set. 

My understanding from reading the documentation , and this list, is that I can do that but I need to use the token() function.

Only it doesn't work.

Here's a reduction:


create table test_paging (
id int,
primary key(id)
);


insert into test_paging (id) values (1);
insert into test_paging (id) values (2);
insert into test_paging (id) values (3);
insert into test_paging (id) values (4);
insert into test_paging (id) values (5);


select * from test_paging where id > token(0);


… but it gives me:


Bad Request: Type error: cannot assign result of function token (type bigint) to id (type int)


… 

What's that about?  I can't find any documentation for this and there aren't any concise examples.


-- 


Founder/CEO Spinn3r.com

Location: San Francisco, CA
Skype: burtonator
blog: http://burtonator.wordpress.com
… or check out my Google+ profile

War is peace. Freedom is slavery. Ignorance is strength. Corporations are people.