I'm new to Cassandra and I'm trying to update a table using this CQL query:
UPDATE analytics SET counter = ? WHERE hash = ?;
I work in PHP using the DataStax php-driver, the code for this statement is this:
$statement = $session->prepare("UPDATE analytics SET counter = ? WHERE hash = ?;");
$session->execute($statement, new Cassandra\ExecutionOptions(array('arguments' => array($count, $hash))));
The table:
CREATE TABLE IF NOT EXISTS analytics (domain VARCHAR, page VARCHAR, ip INET, attributes MAP <VARCHAR, VARCHAR>, hash VARCHAR, counter INT, date TIMESTAMP, PRIMARY KEY(hash, domain, date));
When I execute the statement I get the error "Missing mandatory PRIMARY KEY part domain" so I added the clause ALLOW FILTERING:
UPDATE analytics SET counter = ? WHERE hash = ? ALLOW FILTERING;
But I get another error, "line 1:48 missing EOF at 'ALLOW'". What's is wrong in these queries?