Super columns: supercolumn parameter is not optional for super CF Documents #26

blakesmith opened this Issue Apr 23, 2012 · 2 comments


None yet

2 participants


Hello there!

I seem to be having some trouble creating a mutation on a super column family.

First, I create the column family:

letterleaf.tasks.bootstrap> (ddl/add-column-family cass/cluster cass/keyspace-name {:name "Documents" :type :super :comparator :ascii})

Which yields a schema like so:

create column family Documents
  with column_type = 'Super'
  and comparator = 'AsciiType'
  and subcomparator = 'BytesType'
  and default_validation_class = 'BytesType'
  and key_validation_class = 'BytesType'
  and rows_cached = 0.0
  and row_cache_save_period = 0
  and row_cache_keys_to_save = 0
  and keys_cached = 200000.0
  and key_cache_save_period = 14400
  and read_repair_chance = 1.0
  and gc_grace = 864000
  and min_compaction_threshold = 4
  and max_compaction_threshold = 32
  and replicate_on_write = true
  and row_cache_provider = 'ConcurrentLinkedHashCacheProvider'
  and compaction_strategy = 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy';

Then I try to 'put' rows into the column family:

letterleaf.models.document> (hector/put cass/keyspace "Documents" "" {"123" {"sec-0" "bob"}})

Which throws this exception:

InvalidRequestException(why:supercolumn parameter is not optional for super CF Documents)
  [Thrown class me.prettyprint.hector.api.exceptions.HInvalidRequestException]

 0: [QUIT] Quit to the SLIME top level
 1: [CAUSE1] Invoke debugger on cause   [Thrown class org.apache.cassandra.thrift.InvalidRequestException]

  0: me.prettyprint.cassandra.service.ExceptionsTranslatorImpl.translate
  1: me.prettyprint.cassandra.connection.HConnectionManager.operateWithFailover
  2: me.prettyprint.cassandra.model.ExecutingKeyspace.doExecuteOperation
  3: me.prettyprint.cassandra.model.MutatorImpl.execute
  4:                core.clj:164 clj-hector.core/put
  5:    clojure.lang.RestFn.invoke
  6:            NO_SOURCE_FILE:1 letterleaf.models.document$eval2464.invoke
  7: clojure.lang.Compiler.eval
  8: clojure.lang.Compiler.eval
  9:               core.clj:2382 clojure.core/eval
 10:                core.clj:532 swank.core/eval719[fn]
 11:   clojure.lang.MultiFn.invoke
 12:                basic.clj:54 swank.commands.basic/eval-region
 13:                basic.clj:44 swank.commands.basic/eval-region
 14:                basic.clj:78 swank.commands.basic/eval989[fn]
 15:       clojure.lang.Var.invoke
 16:            (Unknown Source) letterleaf.models.document$eval2462.invoke
 17: clojure.lang.Compiler.eval
 18: clojure.lang.Compiler.eval
 19:               core.clj:2382 clojure.core/eval
 20:                core.clj:100 swank.core/eval-in-emacs-package
 21:                core.clj:256 swank.core/eval-for-emacs
 22:       clojure.lang.Var.invoke
 23:       clojure.lang.AFn.applyToHelper
 24:       clojure.lang.Var.applyTo
 25:                core.clj:540 clojure.core/apply
 26:                core.clj:107 swank.core/eval-from-control
 27:                core.clj:112 swank.core/eval-loop
 28:                core.clj:341 swank.core/spawn-repl-thread[fn]
 29:       clojure.lang.AFn.applyToHelper
 30:       clojure.lang.AFn.applyTo
 31:                core.clj:540 clojure.core/apply
 32:                core.clj:338 swank.core/spawn-repl-thread[fn]
 33:    clojure.lang.RestFn.invoke

Can anyone shed any insight into this exception? I'm new to Cassandra, so I'm probably missing something obvious, but I wasn't sure if it was something specifically with clj-hector.




When doing a put with super columns, you need to explicitly pass the super argument. So in your case:

(hector/put cass/keyspace "Documents" "" {"123" {"sec-0" "bob"}} :type :super)

That being said, you almost certainly shouldn't be using super columns. This quora answer does a good job of explaining why:

Cassandra now has the concept of composite columns that can be used as a replacement for super columns and should generally be used going forward. These links might be helpful:

@nickmbailey nickmbailey was assigned Apr 23, 2012

Hey Nick,

Thanks a bunch for the help and advice. I'm still modeling out my domain, so this is extremely helpful - I'll rewrite what I have using regular columns.

In the meantime, I sent a pull request to update the README to reflect the correct syntax for those who might try this later: #27

Thanks again!


@blakesmith blakesmith closed this Apr 23, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment