A cassandra_InvalidRequestException occurs in Cassandra::getWhere() when using where array format #2.
(I'm new to both PHP and Cassandra and so could be overlooking something obvious.)
Except from Cassandra.php:
* The where array can be a mix of two formats:
* 1. For simplest equality comparison - column value must equal something
* exactly, the format array('column-name' => 'required value') can be
* 2. For any other supported comparison operators, use the slightly longer
* syntax array(array('column-name', Cassandra::OP_LT, 'value')) where
* each component is an array with three values, the first one being the
* column name, second comparison operator and third the value. Use the
* Cassandra::OP_.. constants for operators.
* You can mix the two variants.
Added to example.php (at line 193):
$aged24andOlder = $cassandra->cf('user')->getWhere(
array(array('age', Cassandra::OP_GTE, 24))
echo 'Users aged 24+:
Fatal error: Uncaught exception 'cassandra_InvalidRequestException' in /usr/local/php/lib/php/Cassandra/thrift/packages/cassandra/Cassandra.php:4286
After testing other operators, Cassandra::OP_EQ is the only operator that does not throw an exception.
I believe you can only use the other comparisor operators, you need to have an index set up, see the unit tests file to see how it's done. Also note that when using range queries, you need to use order preserving partitioner. Let me know if that does not work for you.
The Pear package PHPUnit has been installed; but, the test case does not work.
$ php ./CassandraTest.php
Fatal error: Class 'PHPUnit_Framework_TestCase' not found in /opt/air/wise_sync_prototype/php/lib/php/Cassandra/test/CassandraTest.php on line 5