Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default validator comparator type on hector clients: "cannot parse 'SomeColumn' as hex bytes" #674

Open
krishna81m opened this issue Jan 27, 2016 · 3 comments

Comments

@krishna81m
Copy link

I am testing if we can upgrade our cassandra 1.2.13 to 1.2.19 and spun up a single instance and populated data from 1.2 without any problem, everything works, even from a IDE client on thrift:9160 port is able to run this query.

However, hector throws an exception, although we do read by passing key, value, name serializer as string, but shouldn't there be a way to specify the default validator, comparator also as UTF8?
CqlQuery<String, String, String> cqlQuery = new CqlQuery<String, String, String>(instance.getMasterKeyspace(),STR_SERIALIZER,STR_SERIALIZER,STR_SERIALIZER);

The fix was to explicitly create the tables
WITH COMPACT STORAGE

to get the default validator, comparator types to UTF8Type.
http://www.planetcassandra.org/blog/datastax-developer-blog-a-thrift-to-cql3-upgrade-guide/

Caused by: InvalidRequestException(why:cannot parse 'SomeColumn' as hex bytes)
    at org.apache.cassandra.thrift.Cassandra$execute_cql_query_result.read(Cassandra.java:36625)
    at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78)
    at org.apache.cassandra.thrift.Cassandra$Client.recv_execute_cql_query(Cassandra.java:1525)
    at org.apache.cassandra.thrift.Cassandra$Client.execute_cql_query(Cassandra.java:1511)
    at me.prettyprint.cassandra.model.CqlQuery$1.execute(CqlQuery.java:118)
    ... 88 more

@zznate
Copy link
Collaborator

zznate commented Jan 27, 2016

I appreciate the questions and update, but please see this section of the
README:
https://github.com/hector-client/hector/blob/master/README#L3-L10

This project is no longer active.

On Wed, Jan 27, 2016 at 2:02 PM, krishna81m [email protected]
wrote:

I am testing if we can upgrade our cassandra 1213 to 1219 and spun up a
single instance and populated data from 12 without any problem, everything
works, even from a IDE client on thrift:9160 port is able to run this query

However, hector throws an exception, although we do read by passing key,
value, name serializer as string, but shouldn't there be a way to specify
the default validator, comparator also as UTF8?
CqlQuery cqlQuery = new
CqlQuery(instancegetMasterKeyspace(),STR_SERIALIZER,STR_SERIALIZER,STR_SERIALIZER);

The fix was to explicitly create the tables
WITH COMPACT STORAGE

to get the default validator, comparator types to UTF8Type

http://wwwplanetcassandraorg/blog/datastax-developer-blog-a-thrift-to-cql3-upgrade-guide/

Caused by: InvalidRequestException(why:cannot parse 'SomeColumn' as hex bytes)
at orgapachecassandrathriftCassandra$execute_cql_query_resultread(Cassandrajava:36625)
at orgapachethriftTServiceClientreceiveBase(TServiceClientjava:78)
at orgapachecassandrathriftCassandra$Clientrecv_execute_cql_query(Cassandrajava:1525)
at orgapachecassandrathriftCassandra$Clientexecute_cql_query(Cassandrajava:1511)
at meprettyprintcassandramodelCqlQuery$1execute(CqlQueryjava:118)
88 more


Reply to this email directly or view it on GitHub
#674.

@krishna81m
Copy link
Author

Uh oh, we do use both, we have quite a bit of code still using hector, don't think that is an easy migration :)

@Ursula
Copy link

Ursula commented Jan 28, 2016

We do too. When upgrading to Cassandra 2.0 I was able to build and use the 2.0 Hector version successfully in production. We are finding that Hector's performance for bulk loading of data far exceeds the performance of the CQL Driver. However, as you found you will need to use compact storage and define tables using the cli using the old style. For example if you need to have composite keys. e.g.

CREATE COLUMN FAMILY ORDER_LINE WITH COLUMN_TYPE = 'Standard' AND COMPARATOR = 'UTF8Type' AND key_validation_class = 'UTF8Type'
AND default_validation_class = 'UTF8Type'
AND caching = 'NONE'
AND column_metadata = [
{column_name: orderNumber , validation_class: UTF8Type, index_type: KEYS}
{column_name: lineNumber , validation_class: UTF8Type, index_type: KEYS}
{column_name: price , validation_class: UTF8Type}
{column_name: itemTax , validation_class: UTF8Type}
{column_name: itemDesc , validation_class: UTF8Type}
];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants