usando UUID1 con phpcassa

Have following CF:

create column family gr_ip2
with column_type = 'Standard' and comparator = 'TimeUUIDType(reversed=true)' ...;

then do following code:

$uuid1 = phpcassa\UUID::uuid1(null, $time);
$cf->insert("$key"  , array($uuid1 => $url) );

it works without exceptions, but CF at the end is empty.

preguntado el 31 de julio de 12 a las 14:07

What does the Cassandra log say? -

1 Respuestas

$uuid1 is not string, but an object. When we do

$cf->insert("$key"  , array($uuid1 => $url) );

the object is converted to string, and insert fails. phpcassa does not give exeption, but insert fails anyway.

Seems like we need to use ARRAY_FORMAT, so the object not to be "flatten" to string,

$uuid1 = phpcassa\UUID::uuid1(null, $time);

$cf->insert_format = phpcassa\ColumnFamily::ARRAY_FORMAT;

$cf->insert("$key"  , array(
      array($uuid1, $url)
) );

Respondido 31 Jul 12, 17:07

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.