incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lucas Nodine <lucasnod...@gmail.com>
Subject Re: How to Retrieve all the rows from a ColumnFamily
Date Mon, 27 Sep 2010 13:32:36 GMT
Commented your questions below.

HTH

- Lucas Nodine

On Mon, Sep 27, 2010 at 7:35 AM, sekhar kosuru <kosurusekhar@gmail.com>wrote:

> Hi Lucas,
>
> Thanks for the reply.
>
> Please clarify me if i am wrong, this kind of filtering will work on Key
> values in ColumnFamily or any other column available in the ColumnFamily.
>

get_slice - "Get the group of columns contained by column_parent (either a
ColumnFamily name or a ColumnFamily/SuperColumn name pair) specified by the
given SlicePredicate struct." (http://wiki.apache.org/cassandra/API).
Therefore, it matches against keys, and returns all the columns.



>
> One more thing is here we are restricting the out come for 100 records, if
> we are not doing also api is resticting for 100 records.
>
> How to get rid of it, i have many rows satisfying the criteria.
>

Simply change the count to your maximum value, it can be anywhere up to the
maximum value of a 32bit int.  Understand that the SliceRange "is a
structure that stores basic range, ordering and limit information for a
query that will return multiple columns. It could be thought of as
Cassandra's version of LIMIT and ORDER BY."  (
http://wiki.apache.org/cassandra/API).


>
>
> /Regards
> Sekhar.
>
>
> On Mon, Sep 27, 2010 at 5:55 PM, Lucas Nodine <lucasnodine@gmail.com>wrote:
>
>> Example code using C# below:
>>
>> Collections.Generic.List<ColumnOrSuperColumn> results;
>> SlicePredicate predicate;
>> ColumnParent cp;
>>
>> // Create Slice
>> predicate = new SlicePredicate()
>> {
>>   Slice_range = new SliceRange()
>>   {
>>    Start = _utf8.GetBytes(""),
>>    Finish = _utf8.GetBytes(""),
>>    Count = 100,
>>      Reversed = false
>>   }
>> };
>>
>> // Column Parent
>> cp = new ColumnParent() { Column_family = "MetaAssets" };
>>
>> results = _client.get_slice(_utf8.GetBytes(guid.ToString("N")), cp,
>> predicate, ConsistencyLevel.QUORUM);
>>
>>
>> On Mon, Sep 27, 2010 at 2:44 AM, Benjamin Black <b@b3k.us> wrote:
>>
>>> http://wiki.apache.org/cassandra/FAQ#iter_world
>>>
>>> On Sun, Sep 26, 2010 at 11:51 PM, sekhar kosuru <kosurusekhar@gmail.com>
>>> wrote:
>>> > Hi
>>> > I am new to Cassandra Database.
>>> > I want to know how to Retrieve all the records from a column family, is
>>> this
>>> > is different in the clustered servers vs single servers.
>>> > Please suggest me with piece of code if possible.
>>> >
>>> > /Regards
>>> > Sekhar.
>>> >
>>>
>>
>>
>>
>> --
>> Lucas J. Nodine
>> Assistant Labette County Attorney
>> 201 S. Central, Suite B
>> Parsons, KS 67357
>> (620) 421-6370
>>
>
>


-- 
Lucas J. Nodine
Assistant Labette County Attorney
201 S. Central, Suite B
Parsons, KS 67357
(620) 421-6370

Mime
View raw message