Search code examples
cassandradatastax

ServerError: ErrorMessage code=0000 [Server error] message="java.lang.RuntimeEx ception: org.codehaus.jackson.map.JsonMappingException


I am trying to create a columnfamily

cqlsh:testkeyspace> CREATE COLUMNFAMILY testcolumnfamily (rowkey text, ts timest
amp, PRIMARY KEY(rowkey)) with caching=200000 and read_repair_chance=0.4;

ServerError: ErrorMessage code=0000 [Server error] message="java.lang.RuntimeEx ception: org.codehaus.jackson.map.JsonMappingException: Can not deserialize inst ance of java.util.LinkedHashMap out of VALUE_NUMBER_INT token at [Source: java.io.StringReader@1e444c9; line: 1, column: 1]"

I am not able to understand why this error is coming in cassandra.

Edits: you should at least read the official documentation before asking question


Solution

  • For Cassandra 2.0.x

    CREATE TABLE testcolumnfamily (rowkey text, ts timest amp, PRIMARY KEY(rowkey)) with caching='keys_only'and read_repair_chance=0.4;
    

    For Cassandra 2.1.0 and above:

    CREATE TABLE testcolumnfamily (rowkey text, ts timest amp, PRIMARY KEY(rowkey)) with caching='{"keys":"ALL", "rows_per_partition":"10"}' and read_repair_chance=0.4;
    

    Where rows_per_partition is numbers of rows to cache for the partition Create Table in Cassandra