Same for the Column Family name. I thought that CQL names were case sensitive. 
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.

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

Reply via email to