1

I have created a column family by following command using cqlsh:

create table mystats (key PRIMARY KEY, count counter);

Now from the cqlsh I am able to increase the counter column but when I attempt to do this from cassandra gem, as adviced at: Are there any Ruby clients for Cassandra with counters and supercolumn?

So when I use:

@stats.add(:mystats, 'randomkey', 1, 'count')

I get an error:

Cassandra::AccessError at /client Invalid column family "mystats"

When I further looked into it, I found that the error is raised from the gem: in file: https://github.com/twitter/cassandra/blob/master/lib/cassandra/columns.rb

def column_family_property(column_family, key)
      cfdef = schema.cf_defs.find {|cfdef| cfdef.name == column_family }
      unless cfdef
        raise AccessError, "Invalid column family \"#{column_family}\""
      end
      cfdef.send(key)
    end

Can anyone please point out what I might be doing wrong here..

Community
  • 1
  • 1
whizcreed
  • 2,700
  • 3
  • 22
  • 35

1 Answers1

5

That client has not yet been updated to support CQL3. I'm not aware of a CQL3-aware Ruby client, so your best bet is probably to create a Thrift-compatible table (TLDR add WITH COMPACT STORAGE to your table definition).

jbellis
  • 19,347
  • 2
  • 38
  • 47
  • adding with compact storage while creating the table fixed the issue. i found the solution last night in cassandra irc.. thanks answering the question though.. – whizcreed May 07 '13 at 09:48
  • just launched https://github.com/hsgubert/cassandra_migrations to integrate rails with CQL3 and migrations to manage cassandra schema – hsgubert Jun 05 '13 at 01:50