Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php SimpleCassie Cassandra TimeUUID

Tags:

php

cassandra

I created a column family Users using following command:

create column family Users with comparator=TimeUUIDType and default_validation_class=UTF8Type;

Then I insert a column into Users. It shows as follows.

RowKey: jsmith

=>(column=66829930-515b-11e0-8443-0f82b246fa40, value=hello, timestamp=1300451382)

I want to access it using SimpleCassie. The command is:

$data = $cassie->keyspace('Keyspace1')->cf('Users')->key('jsmith')->column('66829930-515b-11e0-8443-0f82b246fa40')->value();

(I also tried: $data = $cassie->keyspace('Keyspace1')->cf('Users')->key('jsmith')->column($cassie->uuid('66829930-515b-11e0-8443-0f82b246fa40')->__toString())->value();)

However, They do not work. It always return NULL. How can I get the column value (hello) I want?

like image 301
chnet Avatar asked Feb 21 '26 08:02

chnet


1 Answers

Try:

$cassie->keyspace('Keyspace1')->cf('Users')->key('jsmith')->column($cassie->uuid('66829930-515b-11e0-8443-0f82b246fa40')->uuid)->value();)

Cassandra expects the binary representation of a UUID, not a hex/string representation.

like image 149
Tyler Hobbs Avatar answered Feb 22 '26 21:02

Tyler Hobbs



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!