Cassandra CQL: Creating and Modifying Column Columns

I am trying to create a counter column through Java, but when I start, I get an error. I am using CQL 3.0.0 and Cassandra 1.1.2

Statement st = con.createStatement();
String data = "CREATE COLUMNFAMILY user_count(priKey text PRIMARY KEY, countME counter)";
st.execute(data);

This is the error I get:

Exception in thread "main" java.sql.SQLSyntaxErrorException:        
org.apache.cassandra.config.ConfigurationException: Cannot add a counter column   
(countme) in a non counter column family

'CREATE COLUMNFAMILY user_count(priKey text PRIMARY KEY, countME counter)'
at org.apache.cassandra.cql.jdbc.CassandraStatement.doExecute(CassandraStatement.java:179)
at org.apache.cassandra.cql.jdbc.CassandraStatement.execute(CassandraStatement.java:203)
at cassandratest.EdgeCreator.aaListData(EdgeCreator.java:1323)
at cassandratest.Main.main(Main.java:214)

I tried to answer the Cassandra cql comparator type counter , but I understand that default_validation for CQL 3.0.0 is no longer used. I searched the documentation but found nothing. I am looking for how to create a family of column counts and grow it using Java. Thanks for the help in advance!

This is also my first post here, so please let me know if something is wrong with him, so I can fix it in the future.

CREATE cqlsh ConfigurationException. cqlsh :

Connected to Test Cluster at localhost:9160.
[cqlsh 3.0.0 | Cassandra 1.1.0 | CQL spec 3.0.0 | Thrift protocol 19.30.0]
Use HELP for help.
cqlsh> use "Keyspace2";
cqlsh:Keyspace2> CREATE COLUMNFAMILY user_count(priKey text PRIMARY KEY, countME
counter);
Bad Request: org.apache.cassandra.config.ConfigurationException: Cannot add a 
counter column (countme) in a non counter column family
cqlsh:Keyspace2>
+5
1

, cql 3? , , , cql 2.

cql 3.

: cql 3, Cassandra 1.1.2. 1.1.0; 1.1.2.

+2

All Articles