我正在尝试将数据存储到 cassandra 中,并按时间排序。使用 TimeUUIDType 作为键时遇到问题。
phpcassa 出现以下错误...
Fatal error: Uncaught exception 'cassandra_InvalidRequestException'
with message 'TimeUUID should be 16 or 0 bytes (6)'
调用插入方法时会发生这种情况...
$pool = new ConnectionPool("Keyspace1", array("localhost:9160"));
$column_family = new ColumnFamily($pool, 'users');
$column_family->insert(CassandraUtil::uuid1(), array('name' => 'value'));
我使用 cassandra-cli 使用以下命令创建了一个测试表...
CREATE COLUMN FAMILY users WITH comparator = TimeUUIDType;