Getting value from a key type TimeUUID in Cassandra-PHP

元气小坏坏 提交于 2019-12-10 15:42:00

问题


I'm new in cassandra and I wanna get the values from a column family, where the key is a TimeUUIDType.

I'm using PHP with PHPCassa, and I can insert(set) correctly in the column family, generating uuid with the function:

$key = CassandraUtil::uuid1();

The problem happen when I try to do a get in the column family, because i have and uuid in String format( something like that):

$uuidString= "e2658820-69f2-11e1-af9a-95dd4f324d9";

I would like to know if is possible cast or transform an String form to a valid uuid for cassandra in php or phpcassa, because my purpose is in another page create the correct uuid from the $uuuidString.

Thanks.


回答1:


CassandraUtil::import($uuidString) will handle that.

Edit As of phpcassa 1.0+, \phpcassa\UUID::import() is the proper method.



来源:https://stackoverflow.com/questions/9638198/getting-value-from-a-key-type-timeuuid-in-cassandra-php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!