CREATE TABLE test (id ascii PRIMARY KEY, test map<bigint,text>);
INSERT INTO test (id, test) VALUES ('Hello', {7: 'World'});
INSERT INTO test (id, test) VALUES ('Foo', {3: 'Bar', 4: 'Baz'});
cqlsh> SELECT * FROM test;
id | test
-------+----------------------
Hello | {7: 'World'}
Foo | {3: 'Bar', 4: 'Baz'}
$pdo = new \PDO('cassandra:host=localhost;port=9160');
$pdo->exec('USE ...;');
$stmt = $pdo->prepare('SELECT * FROM test;');
$stmt->execute();
echo '<pre>';
print_r($stmt->fetchAll(\PDO::FETCH_ASSOC));
echo '</pre>';
Array(
[0] => Array(
[id] => Hello
[test] => Array(
[0] => World // must be: [7] => World
)
)
[1] => Array(
[id] => Foo
[test] => Array(
// [3] => Bar // is lost
[0] => Baz // must be: [4] => Baz
)
)
)