My favorites | Sign in
Project Home Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 15: CQL 3 query over composite keys not working. The table contains 3 keys and one column, but when we make a query using the fields we got an error.
5 people starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----


Sign in to add a comment
 
Reported by marcos.t...@gmail.com, Jan 10, 2013
What steps will reproduce the problem?
$dsn = "cassandra:host=cassandra001,port=9160;host=cassandra002,port=9160;cqlversion=3.0.0";
 $db = new PDO($dsn);
 $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
 $db->exec("USE pollkan");
 
$stmt = $db->prepare("SELECT page, local, key, value FROM lalala;");
$stmt->execute();
$result = $stmt->fetchAll();
var_dump($result);

What is the expected output? What do you see instead?
Expected output:
================
cqlsh:pollkan> select * from lalala;

 page       | local | key   | value
------------+-------+-------+----------------
 teste.html |    EN | title | Ola, bem vindo

Output produced (in /var/log/apache2/error.log):
================================================
[Fri Jan 11 02:17:28 2013] [error] [client 10.0.0.5] PHP Fatal error:  Uncaught exception 'PDOException' with message 'CQLSTATE[08006] [8] No more data to read.' in /var/www/test_cassandra_pdo.php:14\nStack trace:\n#0 /var/www/test_cassandra_pdo.php(14): PDOStatement->execute()\n#1 {main}\n  thrown in /var/www/test_cassandra_pdo.php on line 14

Structure of table "lalala":
============================
cqlsh:pollkan> desc table lalala;

CREATE TABLE lalala (
  page text,
  local text,
  key text,
  value text,
  PRIMARY KEY (page, local, key)
) WITH
  bloom_filter_fp_chance=0.010000 AND
  caching='KEYS_ONLY' AND
  comment='' AND
  dclocal_read_repair_chance=0.000000 AND
  gc_grace_seconds=864000 AND
  read_repair_chance=0.100000 AND
  replicate_on_write='true' AND
  compaction={'class': 'SizeTieredCompactionStrategy'} AND
  compression={'sstable_compression': 'SnappyCompressor'};

What version of the product are you using? On what operating system?
ubuntu 12.04 LTS
Cassandra 1.2
PHP 5.3.10-1ubuntu3.4 with Suhosin-Patch (cli) (built: Sep 12 2012 19:00:43)
Latest cassandra-pdo source

Please provide any additional information below.

Sign in to add a comment

Powered by Google Project Hosting