You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Amrita Jayakumar <am...@gmail.com> on 2011/06/13 14:47:23 UTC
problem in using get_range() function
Hi,
I am trying to retrieve the row_keys in a column_family witht he following
code.
$rows = $column_family->get_range($key_start='R17889000',
$key_finish='R17893999', $row_count=10000000);
$count = 0;
foreach($rows as $rows) {
echo $count.'<br/>';
$count += 1;
print_r($rows);
echo '<br/>';
}
there are 5000 records in the datatbase. But only 526 are getting retrieved.
am i missing out something here???
can anyone help????
Re: problem in using get_range() function
Posted by Richard Low <rl...@acunu.com>.
If you set key_start and key_finish to empty strings then you will get
all rows. You can do this with either RP or OPP, although with RP
they will not be returned in order.
--
Richard Low
Acunu | http://www.acunu.com | @acunu
On Mon, Jun 13, 2011 at 2:31 PM, Amrita Jayakumar
<am...@gmail.com> wrote:
> can u tell me how to retrieve all the row keys in a column family???
>
> On Mon, Jun 13, 2011 at 6:25 PM, Dan Kuebrich <da...@gmail.com>
> wrote:
>>
>> Are you using the order preserving partitioner or the random partitioner
>> for this CF? In order to get the results you expect, you'll need to use the
>> OPP.
>> More
>> info: http://ria101.wordpress.com/2010/02/22/cassandra-randompartitioner-vs-orderpreservingpartitioner/
>> On Mon, Jun 13, 2011 at 8:47 AM, Amrita Jayakumar
>> <am...@gmail.com> wrote:
>>>
>>> Hi,
>>> I am trying to retrieve the row_keys in a column_family witht he
>>> following code.
>>>
>>> $rows = $column_family->get_range($key_start='R17889000',
>>> $key_finish='R17893999', $row_count=10000000);
>>> $count = 0;
>>> foreach($rows as $rows) {
>>> echo $count.'<br/>';
>>> $count += 1;
>>>
>>> print_r($rows);
>>> echo '<br/>';
>>> }
>>>
>>>
>>> there are 5000 records in the datatbase. But only 526 are getting
>>> retrieved. am i missing out something here???
>>> can anyone help????
>>
>
>
Re: problem in using get_range() function
Posted by Amrita Jayakumar <am...@gmail.com>.
can u tell me how to retrieve all the row keys in a column family???
On Mon, Jun 13, 2011 at 6:25 PM, Dan Kuebrich <da...@gmail.com>wrote:
> Are you using the order preserving partitioner or the random partitioner
> for this CF? In order to get the results you expect, you'll need to use the
> OPP.
>
> More info:
> http://ria101.wordpress.com/2010/02/22/cassandra-randompartitioner-vs-orderpreservingpartitioner/
>
> On Mon, Jun 13, 2011 at 8:47 AM, Amrita Jayakumar <
> amritajayakumarcp@gmail.com> wrote:
>
>> Hi,
>> I am trying to retrieve the row_keys in a column_family witht he following
>> code.
>>
>> $rows = $column_family->get_range($key_start='R17889000',
>> $key_finish='R17893999', $row_count=10000000);
>> $count = 0;
>> foreach($rows as $rows) {
>> echo $count.'<br/>';
>> $count += 1;
>>
>> print_r($rows);
>> echo '<br/>';
>> }
>>
>>
>> there are 5000 records in the datatbase. But only 526 are getting
>> retrieved. am i missing out something here???
>> can anyone help????
>>
>
>
Re: problem in using get_range() function
Posted by Dan Kuebrich <da...@gmail.com>.
Are you using the order preserving partitioner or the random partitioner for
this CF? In order to get the results you expect, you'll need to use the
OPP.
More info:
http://ria101.wordpress.com/2010/02/22/cassandra-randompartitioner-vs-orderpreservingpartitioner/
On Mon, Jun 13, 2011 at 8:47 AM, Amrita Jayakumar <
amritajayakumarcp@gmail.com> wrote:
> Hi,
> I am trying to retrieve the row_keys in a column_family witht he following
> code.
>
> $rows = $column_family->get_range($key_start='R17889000',
> $key_finish='R17893999', $row_count=10000000);
> $count = 0;
> foreach($rows as $rows) {
> echo $count.'<br/>';
> $count += 1;
>
> print_r($rows);
> echo '<br/>';
> }
>
>
> there are 5000 records in the datatbase. But only 526 are getting
> retrieved. am i missing out something here???
> can anyone help????
>