I have the following table in cassandra;
CREATE TABLE reports (
c_date text,
c_n int,
c_id timeuuid,
report_id bigint,
report text,
PRIMARY KEY ((c_date, c_n), c_id)
)
c_date
is for querying reports by date.
c_n
is the number of nodes to prevent hotspots(number of nodes to distribute data evenly).
c_id
is the inserted timeuuid.
My select query (cql 3) is the following;
select report, dateOf(c_id), report_id
from keyspace.reports
where c_date = '2013-08-02' and
c_n = 1 and
c_id > minTimeuuid('2013-08-02 02:52:10-0400');
I have successfully get the result set;
However, when I use cql_get_rows()
function implemented on another example (here),
the timestamp (dateOf(id)) cannot be parsed correctly and bigint fields yield the following warning;
PHP Warning: unpack(): Type N: not enough input, need 4, have 0
in /home/arascan/my-project/tools/vendor/phpcassa/lib/phpcassa/Schema/DataType/LongType.php on line 47
The returned data from cql_get_rows()
is the following;
[0] => Array
(
[reportid] => 281474976712782
[report] => some_report
[dateOf(c_id)] => d:1375426331.32100009918212890625;
)
How can I prevent this function throw warning and get the timestamp in date format? (Please don't suggest @ usage)