Open anhphuong opened 11 years ago
Are you using order-preserving partitioner?
Thanks so much for your care, kallaspriit :D I don't understand mush about your question. I only tried run "example.php", and then I add new code for purpose Select list of data where age greater than 20 (at example.php, it only have code to Select where age equal 24 year)
so, are you sure this problem is about Cassandra Server config ?
Most likely, the example.php includes a comparison OP too that is commented out because it does not work with default config.
Hi kallaspriit,
Thanks a lot for your help :D
I try open file cassandra.yaml follow your guide, then change the line: partitioner: org.apache.cassandra.dht.Murmur3Partitioner to partitioner: org.apache.cassandra.dht.OrderPreservingPartitioner
Then, I restart Cassandra.
I try run my code (php) again, it still had above problem :(
So, what's wrong I missed ?
Hi kallaspriit,
I try uncomment this line:
$usersAZ = $cassandra->cf ( 'user' )->getKeyRange ( 'a', 'z' ); print_r ( $usersAZ->getAll (), true );
The result show OK like that: Array (
[jane.doe] => Array
(
[age] => 24
[email] => jane@doe.com
[name] => Jane Doe
)
[john] => Array
(
[age] => 34
[email] => john@smith.com
[name] => John Smith
)
)
But, my code: $aged20plus = $cassandra->cf ( 'user' )->getWhere ( array ( array ( 'age', Cassandra::OP_GT, 20 ) ) ); print_r ( $aged20plus->getAll(), true );
Still show Exception: "Failed calling "get_indexed_slices" the maximum of 5 times" :(
The error message you’re seeing indicates that the Cassandra driver has failed to retrieve the data you requested. This could be due to a number of reasons, such as network connectivity issues, incorrect configuration settings, or a bug in the driver itself.
it seems that this error message is often caused by a timeout issue. You might want to try increasing the timeout value in your code and see if that resolves the issue. Alternatively, you could try optimizing your query by adding an index on the ‘age’ column 1.
Hi, I have an problem when I try to get data by Operator Greater & Less than.
First, I use this code: $aged24 = $cassandra->cf ( 'user' )->getWhere ( array ( array ( 'age', Cassandra::OP_EQ, 24 ) ) ); echo 'Users 24:
';
The result OK, it showed: Array ( [jane.doe] => Array ( [age] => 24 [email] => jane@doe.com [name] => Jane Doe ) )
But, when I want get Greater, I changed code to: $aged20plus = $cassandra->cf ( 'user' )->getWhere ( array ( array ( 'age', Cassandra::OP_GT, 20 ) ) ); echo 'Users 20+:
';
The result have Exception: "Failed calling "get_indexed_slices" the maximum of 5 times"
Please help me solve this problem. Thanks so much ^_^