Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9C7AE10ABC for ; Tue, 17 Sep 2013 22:34:08 +0000 (UTC) Received: (qmail 14905 invoked by uid 500); 17 Sep 2013 22:33:55 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 14860 invoked by uid 500); 17 Sep 2013 22:33:53 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 14846 invoked by uid 99); 17 Sep 2013 22:33:53 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Sep 2013 22:33:53 +0000 Date: Tue, 17 Sep 2013 22:33:52 +0000 (UTC) From: "Jonathan Ellis (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-6033) CQL: allow names for bind variables MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-6033?page=3Dcom.atlas= sian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D= 13770089#comment-13770089 ]=20 Jonathan Ellis commented on CASSANDRA-6033: ------------------------------------------- =08I've already wished for this a few times, but to play devil's advocate, = isn't it a bit late to change this now that we have multiple drivers in pro= duction? I submit that users have already made their peace with this. =20 > CQL: allow names for bind variables > ----------------------------------- > > Key: CASSANDRA-6033 > URL: https://issues.apache.org/jira/browse/CASSANDRA-6033 > Project: Cassandra > Issue Type: Bug > Reporter: Sylvain Lebresne > > Currently bind variables are "anonymous", they're just a question mark. W= hat this means is that the only reliable way to reference those variables a= fter preparation is through position their position in the query string, wh= ich is not excessively user friendly. > Of course some driver may be tempted to add their own version of named va= riables, but that forces said driver to parse the query string in the first= place, which is something we've tried to avoid so far. Besides, this is us= eful enough that making it part of CQL would make this more consistent amon= gst driver rather than having everyone coming up with its own syntax. > I'll add that because we are already sending column names in the metadata= , I believe we can support this without any change to the protocol. The ide= a would be to support queries like this (happy to discuss the exact syntax)= : > {noformat} > SELECT * FROM test WHERE key =3D ?my_key AND time > ?t_low AND time <=3D = ?t_high > {noformat} > From the Cassandra side, the only thing that this would change is that in= the result set returned to the client, the column names would be 'my_key',= 't_low' and 't_high' respectively rather than 'key', 'time' and 'time' as = they are now. And so in particular using an anymous variable would be equi= valent to using a name one with the name of the CQL column the variable is = bound to. > Driver side, the driver would just have to keep a map of each name to the= ir position in the metadata to provide reliable setter by names. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs For more information on JIRA, see: http://www.atlassian.com/software/jira