You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cassandra.apache.org by Vivek Mishra <vi...@yahoo.com> on 2013/08/25 09:05:10 UTC

Fw: Fwd: CQLsh assume command

Hi,
fyi. 

Cqlsh ASSUME command, does it work with INSERT statement?

Any suggestions?

-Vivek

---------- Forwarded message ----------
From: Vivek Mishra <mi...@gmail.com>
Date: Sun, Aug 25, 2013 at 12:58 AM
Subject: CQLsh assume command
To: user@cassandra.apache.org



Hi,
i am trying to get CQL3 ASSUME command working, as it works with Cassandra-cli.

In my example, i have create a table as :

create table
default(id blob PRIMARY KEY);
Then after connecting with CQLsh(version 3), i did execute:
assume default(id) values are text;
and then tried to insert a simple record as :


insert into default(id) values('1');

But still i am getting error as:
Bad Request: cannot parse '1' as hex bytes

Any suggestion, what am i doing incorrect here?

-Vivek

Re: CQLsh assume command

Posted by Vivek Mishra <vi...@yahoo.com>.
I did post on user mailing list as well. 
I understand that, we can use these functions with each DDL/DML statement, but prior 2.0, ASSUME function should have worked as per provided definition.

Thanks for your reply.


-Vivek

________________________________
 From: Aleksey Yeschenko <al...@yeschenko.com>
To: dev@cassandra.apache.org; Vivek Mishra <vi...@yahoo.com> 
Sent: Sunday, August 25, 2013 7:37 PM
Subject: Re: CQLsh assume command
 

This is a wrong mailing list for this kind of questions.

That aside, you should use CQL3 conversion functions instead, that work both for INSERT/UPDATE and SELECT.

INSERT INTO default(id) VALUES (textAsBlob('1'));
SELECT blobAsText(id) FROM default;

ASSUME is gone in 2.0. 

-- 
AY


On Sunday, August 25, 2013 at 10:05 AM, Vivek Mishra wrote:

> Hi,
> fyi. 
> 
> Cqlsh ASSUME command, does it work with INSERT statement?
> 
> Any suggestions?
> 
> -Vivek
> 
> ---------- Forwarded message ----------
> From: Vivek Mishra <mishra.vivs@gmail.com (mailto:mishra.vivs@gmail.com)>
> Date: Sun, Aug 25, 2013 at 12:58 AM
> Subject: CQLsh assume command
> To: user@cassandra.apache.org (mailto:user@cassandra.apache.org)
> 
> 
> 
> Hi,
> i am trying to get CQL3 ASSUME command working, as it works with Cassandra-cli.
> 
> In my example, i have create a table as :
> 
> create table
> default(id blob PRIMARY KEY);
> Then after connecting with CQLsh(version 3), i did execute:
> assume default(id) values are text;
> and then tried to insert a simple record as :
> 
> 
> insert into default(id) values('1');
> 
> But still i am getting error as:
> Bad Request: cannot parse '1' as hex bytes
> 
> Any suggestion, what am i doing incorrect here?
> 
> -Vivek 

Re: CQLsh assume command

Posted by Aleksey Yeschenko <al...@yeschenko.com>.
This is a wrong mailing list for this kind of questions.

That aside, you should use CQL3 conversion functions instead, that work both for INSERT/UPDATE and SELECT.

INSERT INTO default(id) VALUES (textAsBlob('1'));
SELECT blobAsText(id) FROM default;

ASSUME is gone in 2.0. 

-- 
AY


On Sunday, August 25, 2013 at 10:05 AM, Vivek Mishra wrote:

> Hi,
> fyi. 
> 
> Cqlsh ASSUME command, does it work with INSERT statement?
> 
> Any suggestions?
> 
> -Vivek
> 
> ---------- Forwarded message ----------
> From: Vivek Mishra <mishra.vivs@gmail.com (mailto:mishra.vivs@gmail.com)>
> Date: Sun, Aug 25, 2013 at 12:58 AM
> Subject: CQLsh assume command
> To: user@cassandra.apache.org (mailto:user@cassandra.apache.org)
> 
> 
> 
> Hi,
> i am trying to get CQL3 ASSUME command working, as it works with Cassandra-cli.
> 
> In my example, i have create a table as :
> 
> create table
> default(id blob PRIMARY KEY);
> Then after connecting with CQLsh(version 3), i did execute:
> assume default(id) values are text;
> and then tried to insert a simple record as :
> 
> 
> insert into default(id) values('1');
> 
> But still i am getting error as:
> Bad Request: cannot parse '1' as hex bytes
> 
> Any suggestion, what am i doing incorrect here?
> 
> -Vivek