Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8221577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:58:26+00:00 2026-06-07T13:58:26+00:00

I am trying to create a counter column through Java but I am getting

  • 0

I am trying to create a counter column through Java but I am getting an error when running it.
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 that I am getting:

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 have tried the answer to Cassandra cql comparator type counter but I understand that default_validation for CQL 3.0.0 is no longer useable. I have searched the documentation but have found nothing. I am looking how to create a counter column family and increment it, using Java.
Thanks for the help in advance!

This is also my first post on here, so please let me know if there is anything wrong with it so I can correct it in the future.

Update
When using the CREATE statement in cqlsh, I get a ConfigurationException. The cqlsh session follows:

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>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T13:58:27+00:00Added an answer on June 7, 2026 at 1:58 pm

    Are you sure you’re using cql 3? It looks from your traceback like you’re not, and that’s the error I would expect if you were accidentally using cql 2.

    That create statement should work in cql 3.

    Edit: You were using cql 3, but you weren’t using Cassandra 1.1.2. That was a known bug with 1.1.0; it should be fixed if you upgrade to 1.1.2.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a simple Hit Counter using Kohana3 and PHP. But
Trying to create a background-image slideshow and am getting this error... This is the
Im trying to create counter that using shared block memory, just look code: $i=0;
I am trying to create a custom week counter but am having quite a
i'm trying to create running counter for SQL data in asp. For example, Name
I'm trying create a bot which automatically likes Facebook posts. Using Mechanize I can
Ok so I am trying create a login script, here I am using PHP5
Trying to create a black line in my view to separate text blocks but
Trying to create a new Dedicated Cache Role in Windows Azure but get the
I'm trying to create a performance counter that can monitor the performance time of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.