You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cassandra.apache.org by Pierre Chalamet <pi...@chalamet.net> on 2012/05/11 23:37:23 UTC

CqlPreparedResult enhancements ?

Hi,

 

I hit some serious limitations with prepared statement in Cassandra 1.1. The
problem is CqlPreparedResult which brings no value for high level api
builders.

 

For example, after prepare_cql_query on this query:

insert into People (firstname, lastname, birthyear) values (?, ?, ?)

 

I'd really like to discover the parameters names ('firstname', 'lastname'
and 'birthyear') with types if available from cf metadata if available.

For the moment, there is just nothing returned. Sad.

 

Knowing the names and types of the parameters could open a lot of
possibilities client side like a smart framework to feed parameters.

There is no problem with CqlResult since there is all the needed
informations.

 

Are there any plan to enhance prepared statements and specially
CqlPreparedResult ? In the current state, it's pretty limited and it's
impossible to create a great framework around prepared statement.

 

Thanks,

- Pierre

 


RE: CqlPreparedResult enhancements ?

Posted by Pierre Chalamet <pi...@chalamet.net>.
CASSANDRA-4242. I've added a patch too if this could help (based on
cassandra-1.1.0).

Cheers,
- Pierre

-----Original Message-----
From: Pierre Chalamet [mailto:pierre@chalamet.net] 
Sent: samedi 12 mai 2012 17:30
To: dev@cassandra.apache.org
Subject: Re: CqlPreparedResult enhancements ?

Hi Eric,

I'm not sad anyway :)

Having only types is not enough for the framework I'd like to implement
client side. Prepare server side knows for sure what are the names of the
parameters. Adding that to the parameters types will be perfect so.

And I'm not asking for backport on v2. I do not mind targeting v3 and
Cassandra 1.1+ only.

I will open an improvement ticket to add parameters names to
CqlPreparedResult then.

Thanks !


- Pierre

-----Original Message-----
From: Eric Evans <ee...@acunu.com>
Date: Sat, 12 May 2012 10:12:54
To: <de...@cassandra.apache.org>
Reply-To: dev@cassandra.apache.org
Subject: Re: CqlPreparedResult enhancements ?

On Fri, May 11, 2012 at 4:37 PM, Pierre Chalamet <pi...@chalamet.net>
wrote:
> I hit some serious limitations with prepared statement in Cassandra 
> 1.1. The problem is CqlPreparedResult which brings no value for high 
> level api builders.
>
> For example, after prepare_cql_query on this query:
>
> insert into People (firstname, lastname, birthyear) values (?, ?, ?)
>
>
> I'd really like to discover the parameters names ('firstname', 'lastname'
> and 'birthyear') with types if available from cf metadata if available.
>
> For the moment, there is just nothing returned. Sad.

There, there, don't be sad.  Keep your chin up, it'll be OK.

For what it's worth, CQL3 (use set_cql_version("3")) does return variable
types.  I haven't looked, so I'm not sure how difficult it would be to
backport this to CQL2, but why not open a ticket and see?

--
Eric Evans
Acunu | http://www.acunu.com | @acunu


Re: CqlPreparedResult enhancements ?

Posted by Pierre Chalamet <pi...@chalamet.net>.
Hi Eric,

I'm not sad anyway :)

Having only types is not enough for the framework I'd like to implement client side. Prepare server side knows for sure what are the names of the parameters. Adding that to the parameters types will be perfect so.

And I'm not asking for backport on v2. I do not mind targeting v3 and Cassandra 1.1+ only.

I will open an improvement ticket to add parameters names to CqlPreparedResult then.

Thanks !


- Pierre

-----Original Message-----
From: Eric Evans <ee...@acunu.com>
Date: Sat, 12 May 2012 10:12:54 
To: <de...@cassandra.apache.org>
Reply-To: dev@cassandra.apache.org
Subject: Re: CqlPreparedResult enhancements ?

On Fri, May 11, 2012 at 4:37 PM, Pierre Chalamet <pi...@chalamet.net> wrote:
> I hit some serious limitations with prepared statement in Cassandra 1.1. The
> problem is CqlPreparedResult which brings no value for high level api
> builders.
>
> For example, after prepare_cql_query on this query:
>
> insert into People (firstname, lastname, birthyear) values (?, ?, ?)
>
>
> I'd really like to discover the parameters names ('firstname', 'lastname'
> and 'birthyear') with types if available from cf metadata if available.
>
> For the moment, there is just nothing returned. Sad.

There, there, don't be sad.  Keep your chin up, it'll be OK.

For what it's worth, CQL3 (use set_cql_version("3")) does return
variable types.  I haven't looked, so I'm not sure how difficult it
would be to backport this to CQL2, but why not open a ticket and see?

-- 
Eric Evans
Acunu | http://www.acunu.com | @acunu

Re: CqlPreparedResult enhancements ?

Posted by Eric Evans <ee...@acunu.com>.
On Fri, May 11, 2012 at 4:37 PM, Pierre Chalamet <pi...@chalamet.net> wrote:
> I hit some serious limitations with prepared statement in Cassandra 1.1. The
> problem is CqlPreparedResult which brings no value for high level api
> builders.
>
> For example, after prepare_cql_query on this query:
>
> insert into People (firstname, lastname, birthyear) values (?, ?, ?)
>
>
> I'd really like to discover the parameters names ('firstname', 'lastname'
> and 'birthyear') with types if available from cf metadata if available.
>
> For the moment, there is just nothing returned. Sad.

There, there, don't be sad.  Keep your chin up, it'll be OK.

For what it's worth, CQL3 (use set_cql_version("3")) does return
variable types.  I haven't looked, so I'm not sure how difficult it
would be to backport this to CQL2, but why not open a ticket and see?

-- 
Eric Evans
Acunu | http://www.acunu.com | @acunu