cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Lebresne <sylv...@datastax.com>
Subject Re: Thrift execute_cql3_query function seems to require that keyspace name is lowercase and is creating keyspaces with a lower case name
Date Fri, 07 Feb 2014 14:08:00 GMT
On Fri, Feb 7, 2014 at 2:48 PM, Desimpel, Ignace <Ignace.Desimpel@nuance.com
> wrote:

>  Same for the Column Family name. I thought that CQL names were case
> sensitive.
>

You though wrong: http://cassandra.apache.org/doc/cql3/CQL.html#identifiers



> Also make it impossible to use this interface to query for existing
> keyspaces that were created with thrift interface and that have capitals in
> the name.
>

No it doesn't, but you need to double quote your names if you want the case
to be preserved, i.e. CREATE KEYSPACE "KK1" WITH ... will create a truly
uppercase keyspace name. Of course, if you only use CQL, there is no real
point in forcing the case of your identifiers.

--
Sylvain


>
>
> Did I read it wrongly?
>
>
>
> Simple example :
>
>
>
> String sCreateKs = "CREATE KEYSPACE KK1 WITH replication = {'class':
> 'SimpleStrategy', 'replication_factor' : 1} ";
>
> oCqlResult = oCassClt.execute_cql3_query(ByteBuffer.*wrap*(sCreateKs.getBytes(UTF8)),
> Compression.*NONE*, ConsistencyLevel.*QUORUM*);
>
>
>
> //This will fail since keyspace was created with a lowercase name!!!
>
> oCassClt.set_keyspace("KK1");
>
>
>
> Other example :
>
>
>
> String sCreateKs = "CREATE KEYSPACE KK1 WITH replication = {'class':
> 'SimpleStrategy', 'replication_factor' : 1} ";
>
> oCqlResult = oCassClt.execute_cql3_query(ByteBuffer.*wrap*(sCreateKs.getBytes(UTF8)),
> Compression.*NONE*, ConsistencyLevel.*QUORUM*);
>
>
>
> oCassClt.set_keyspace("kk1"); //Must be in lowercase
>
>
>
> //Will create a column family with lowercase name cc1 !!!
>
> String sCreateColFam = "CREATE COLUMNFAMILY CC1 ( c1name text PRIMARY
> KEY)";
>
> oCqlResult = oCassClt.execute_cql3_query(ByteBuffer.*wrap*(sCreateColFam.getBytes(UTF8)),
> Compression.*NONE*, ConsistencyLevel.*QUORUM*);
>
>
>
> Regards,
>
>
>
> Ignace Desimpel
>

Mime
View raw message