Net::Cassandra::Easy equivalent of "SELECT * FROM ..."
Posted
by knorv
on Stack Overflow
See other posts from Stack Overflow
or by knorv
Published on 2010-03-22T19:35:46Z
Indexed on
2010/03/22
19:41 UTC
Read the original article
Hit count: 549
When using Perl's Net::Cassandra::Easy
the following code will retrieve columns col[1-3]
from rows row[1-3]
:
$result = $cassandra->get(['row1', 'row2', 'row3'], family => 'Standard1', byname => ['col1', 'col2', 'col3');
The corresponding SQL would be:
SELECT col1, col2, col3 FROM rows WHERE id IN ('row1', 'row2', 'row3');
Suppose instead that I want to retrieve all columns. In SQL terms that would be:
SELECT * FROM rows WHERE id IN ('row1', 'row2', 'row3');
To get all columns I am currently using:
$result = $cassandra->get(['row1', 'row2', 'row3'], family => 'Standard1', byoffset => { "count" => 1_000_000 });
This works as long as the number of columns does not exceed one million. While this works I'd assume that there is a cleaner way to do it. My question is: Is there any cleaner way to specify to Cassandra that I want to retrieve all columns for the maching rows?
© Stack Overflow or respective owner