Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I store and retrieve TimeUUIDType types with Net::Cassandra::Easy?

Doing the following:

my $c = Net::Cassandra::Easy->new(server => 'localhost', port => '9160', keyspace => 'Keyspace1'); $c->connect();

my $uuid_bin = Data::UUID->new()->create_bin();
eval { $result = $c->mutate([$key],
                            family => 'StandardByUUID1',
                            insertions => { $uuid_bin => '123' });
};
warn $@ if $@;

Result is a:

Net::GenCassandra::InvalidRequestException

I didn't see anything similar to Net::Cassandra::Easy::pack_decimal for UUIDs.

like image 791
Holden Robbins Avatar asked Nov 15 '22 11:11

Holden Robbins


1 Answers

Perhaps the Java code here will be useful: http://wiki.apache.org/cassandra/FAQ#working_with_timeuuid_in_java

like image 164
jbellis Avatar answered Apr 29 '23 13:04

jbellis