jsevellec/cassandra-unit — Issue #7: defaultColumnValueType possibly gets ignored when using hector CQL
Author: Tielem
Created: 2012-01-21 20:46:41+00:00
State: open

We are trying to test our cassandra + hector code using cassandra-unit.
To do so, we made the following fixture: http://pastebin.com/76zjghQ9

We are able to retrieve the data inside the fixture by doing a hector CQL call

SELECT * FROM test;

However, when trying to update or insert a row with the following query

UPDATE test USING CONSISTENCY ALL SET 'method' = 'namedMethodValue', 'unnamedMethod' = 'unnamedMethodValue', field' = 'namedFieldValue', 'unnamedField' = 'unnamedFieldValue' WHERE KEY = 'KEY';

Hector throws the following error

me.prettyprint.hector.api.exceptions.HInvalidRequestException:
InvalidRequestException(why:cannot parse 'unnamedMethodValue' as hex
bytes)
at me.prettyprint.cassandra.service.ExceptionsTranslatorImpl.translate(ExceptionsTranslatorImpl.java:52)
at me.prettyprint.cassandra.model.CqlQuery$1.execute(CqlQuery.java:130)
at me.prettyprint.cassandra.model.CqlQuery$1.execute(CqlQuery.java:100)

The Hector CQL page suggests that it would mean that either the query or the validators are invalid, however both look correct to me.

Also,

If we create the columnfamily by doing the CQL query

CREATE COLUMNFAMILY " + "test" + " (" +
"KEY text PRIMARY KEY," +
"field text," +
"unnamedField text," +
"method text," +
"unnamedMethod text" +
")

It all works fine ..

Any ideas?

Kind regards,
Maarten