I'm trying to store data into cassandra with it being ordered by time. Having trouble using the TimeUUIDType as the key.
I get the following error with phpcassa...
Fatal error: Uncaught exception 'cassandra_InvalidRequestException'
with message 'TimeUUID should be 16 or 0 bytes (6)'
This occurs when calling the insert method...
$pool = new ConnectionPool("Keyspace1", array("localhost:9160"));
$column_family = new ColumnFamily($pool, 'users');
$column_family->insert(CassandraUtil::uuid1(), array('name' => 'value'));
I created a test table using cassandra-cli with the following command...
CREATE COLUMN FAMILY users WITH comparator = TimeUUIDType;
comparator
applies to column names, not row keys. If you want the row keys to be TimeUUIDs, you should set key_validation_class
instead.
You're getting this exception because Cassandra is expecting a TimeUUID for the column name, but you're passing a normal string.