You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Christian Torres <ch...@gmail.com> on 2010/04/20 18:50:05 UTC

Filters

Hello!

Is there any way to make filters (WHEREs) in cassandra? Or I have to manages
to do it

For example:

I have a ColumnFamily with a column in each row whose value is a state...
Public or Private, so I want to filter all rows that are private and also
the public ones in other form... Beside in that rows I will have names of
persons and I'll need to filter by Initials or Complete Lastnames, etc.

*So any idea?*

Regards

-- 
Christian Torres * Desarrollador Web * Guegue.com *
Celular: +505 84 65 92 62 * Loving of the Programming

Re: Filters

Posted by Miguel Verde <mi...@gmail.com>.
http://wiki.apache.org/cassandra/API#get_slice
get_slice retrieves the values for either (a) a list of column names or (b)
a range of columns, depending on the SlicePredicate you use.  It does not
allow you to filter a la SQL's WHERE.  You would need to create your own
index to do so, at least until secondary indices are implemented in
Cassandra (not until 0.8 at least, feel free to follow
https://issues.apache.org/jira/browse/CASSANDRA-749 )
On Tue, Apr 20, 2010 at 12:24 PM, Christian Torres <ch...@gmail.com>wrote:

> Mmmm...
>
> According with this doc http://wiki.apache.org/cassandra/API#get_slicethat a developer mailed to me It's possible!!
>
> I sent you as reference
>
>
> On Tue, Apr 20, 2010 at 11:17 AM, Mark Jones <MJ...@imagehawk.com> wrote:
>
>>  You will have to pull the columns and filter yourself.
>>
>>
>>
>> *From:* Christian Torres [mailto:chtorrez@gmail.com]
>> *Sent:* Tuesday, April 20, 2010 11:50 AM
>> *To:* user@cassandra.apache.org
>> *Cc:* dev@cassandra.apache.org
>> *Subject:* Filters
>>
>>
>>
>> Hello!
>>
>> Is there any way to make filters (WHEREs) in cassandra? Or I have tomanages to doit
>>
>> For example:
>>
>> I have a ColumnFamily with a column in each row whose value is a state...
>> Public or Private, so I want to filter all rows that are private and also
>> the public ones in other form... Beside in that rows I will have names of
>> persons and I'll need to filter by Initials or Complete Lastnames, etc.
>>
>> *So any idea?*
>>
>> Regards
>>
>> --
>> Christian Torres * Desarrollador Web * Guegue.com *
>> Celular: +505 84 65 92 62 * Loving of the Programming
>>
>
>
>
> --
> Christian Torres * Desarrollador Web * Guegue.com *
> Celular: +505 84 65 92 62 * Loving of the Programming
>

RE: Filters

Posted by Mark Jones <MJ...@imagehawk.com>.
If you notice the SlicePredicate accepts column names, but not values.  You can tell it pull these 3 columns, but there is no "if/where" in there.

SliceRange is I think, based on the key, since it doesn't have a way to pair up column names/values

From: Christian Torres [mailto:chtorrez@gmail.com]
Sent: Tuesday, April 20, 2010 12:25 PM
To: user@cassandra.apache.org
Subject: Re: Filters

Mmmm...

According with this doc http://wiki.apache.org/cassandra/API#get_slice that a developer mailed to me It's possible!!

I sent you as reference
On Tue, Apr 20, 2010 at 11:17 AM, Mark Jones <MJ...@imagehawk.com>> wrote:
You will have to pull the columns and filter yourself.

From: Christian Torres [mailto:chtorrez@gmail.com<ma...@gmail.com>]
Sent: Tuesday, April 20, 2010 11:50 AM
To: user@cassandra.apache.org<ma...@cassandra.apache.org>
Cc: dev@cassandra.apache.org<ma...@cassandra.apache.org>
Subject: Filters

Hello!

Is there any way to make filters (WHEREs) in cassandra? Or I have to manages to do it

For example:

I have a ColumnFamily with a column in each row whose value is a state... Public or Private, so I want to filter all rows that are private and also the public ones in other form... Beside in that rows I will have names of persons and I'll need to filter by Initials or Complete Lastnames, etc.

So any idea?

Regards

--
Christian Torres * Desarrollador Web * Guegue.com *
Celular: +505 84 65 92 62 * Loving of the Programming



--
Christian Torres * Desarrollador Web * Guegue.com *
Celular: +505 84 65 92 62 * Loving of the Programming

Re: Filters

Posted by Christian Torres <ch...@gmail.com>.
And the key would be the state or value matched, I'm getting it well?

On Tue, Apr 20, 2010 at 2:46 PM, Christian Torres <ch...@gmail.com>wrote:

> So the sugestion would be create a column family with the values or states
> and with columns save the matches?
>
>
> On Tue, Apr 20, 2010 at 11:27 AM, Roger Schildmeijer <
> schildmeijer@gmail.com> wrote:
>
>> My bad. Missed your one-to-one relationship (row key <-> column
>>
>> )
>> On 20 apr 2010, at 19.24em, Christian Torres wrote:
>>
>> Mmmm...
>>
>> According with this doc http://wiki.apache.org/cassandra/API#get_slicethat a developer mailed to me It's possible!!
>>
>> I sent you as reference
>>
>> On Tue, Apr 20, 2010 at 11:17 AM, Mark Jones <MJ...@imagehawk.com>wrote:
>>
>>>  You will have to pull the columns and filter yourself.
>>>
>>>
>>> *From:* Christian Torres [mailto:chtorrez@gmail.com]
>>> *Sent:* Tuesday, April 20, 2010 11:50 AM
>>> *To:* user@cassandra.apache.org
>>> *Cc:* dev@cassandra.apache.org
>>> *Subject:* Filters
>>>
>>>
>>> Hello!
>>>
>>> Is there any way to make filters (WHEREs) in cassandra? Or I have tomanages to doit
>>>
>>> For example:
>>>
>>> I have a ColumnFamily with a column in each row whose value is a state...
>>> Public or Private, so I want to filter all rows that are private and also
>>> the public ones in other form... Beside in that rows I will have names of
>>> persons and I'll need to filter by Initials or Complete Lastnames, etc.
>>>
>>> *So any idea?*
>>>
>>> Regards
>>>
>>> --
>>> Christian Torres * Desarrollador Web * Guegue.com *
>>> Celular: +505 84 65 92 62 * Loving of the Programming
>>>
>>
>>
>>
>> --
>> Christian Torres * Desarrollador Web * Guegue.com *
>> Celular: +505 84 65 92 62 * Loving of the Programming
>>
>>
>>
>
>
> --
> Christian Torres * Desarrollador Web * Guegue.com *
> Celular: +505 84 65 92 62 * Loving of the Programming
>



-- 
Christian Torres * Desarrollador Web * Guegue.com *
Celular: +505 84 65 92 62 * Loving of the Programming

Re: Filters

Posted by Christian Torres <ch...@gmail.com>.
So the sugestion would be create a column family with the values or states
and with columns save the matches?

On Tue, Apr 20, 2010 at 11:27 AM, Roger Schildmeijer <schildmeijer@gmail.com
> wrote:

> My bad. Missed your one-to-one relationship (row key <-> column
>
> )
> On 20 apr 2010, at 19.24em, Christian Torres wrote:
>
> Mmmm...
>
> According with this doc http://wiki.apache.org/cassandra/API#get_slicethat a developer mailed to me It's possible!!
>
> I sent you as reference
>
> On Tue, Apr 20, 2010 at 11:17 AM, Mark Jones <MJ...@imagehawk.com> wrote:
>
>>  You will have to pull the columns and filter yourself.
>>
>>
>> *From:* Christian Torres [mailto:chtorrez@gmail.com]
>> *Sent:* Tuesday, April 20, 2010 11:50 AM
>> *To:* user@cassandra.apache.org
>> *Cc:* dev@cassandra.apache.org
>> *Subject:* Filters
>>
>>
>> Hello!
>>
>> Is there any way to make filters (WHEREs) in cassandra? Or I have tomanages to doit
>>
>> For example:
>>
>> I have a ColumnFamily with a column in each row whose value is a state...
>> Public or Private, so I want to filter all rows that are private and also
>> the public ones in other form... Beside in that rows I will have names of
>> persons and I'll need to filter by Initials or Complete Lastnames, etc.
>>
>> *So any idea?*
>>
>> Regards
>>
>> --
>> Christian Torres * Desarrollador Web * Guegue.com *
>> Celular: +505 84 65 92 62 * Loving of the Programming
>>
>
>
>
> --
> Christian Torres * Desarrollador Web * Guegue.com *
> Celular: +505 84 65 92 62 * Loving of the Programming
>
>
>


-- 
Christian Torres * Desarrollador Web * Guegue.com *
Celular: +505 84 65 92 62 * Loving of the Programming

Re: Filters

Posted by Roger Schildmeijer <sc...@gmail.com>.
My bad. Missed your one-to-one relationship (row key <-> column

)
On 20 apr 2010, at 19.24em, Christian Torres wrote:

> Mmmm...
> 
> According with this doc http://wiki.apache.org/cassandra/API#get_slice that a developer mailed to me It's possible!!
> 
> I sent you as reference
> 
> On Tue, Apr 20, 2010 at 11:17 AM, Mark Jones <MJ...@imagehawk.com> wrote:
> You will have to pull the columns and filter yourself.
> 
>  
> From: Christian Torres [mailto:chtorrez@gmail.com] 
> Sent: Tuesday, April 20, 2010 11:50 AM
> To: user@cassandra.apache.org
> Cc: dev@cassandra.apache.org
> Subject: Filters
> 
>  
> Hello!
> 
> Is there any way to make filters (WHEREs) in cassandra? Or I have to manages to do it
> 
> For example:
> 
> I have a ColumnFamily with a column in each row whose value is a state... Public or Private, so I want to filter all rows that are private and also the public ones in other form... Beside in that rows I will have names of persons and I'll need to filter by Initials or Complete Lastnames, etc.
> 
> So any idea?
> 
> Regards
> 
> -- 
> Christian Torres * Desarrollador Web * Guegue.com *
> Celular: +505 84 65 92 62 * Loving of the Programming
> 
> 
> 
> 
> -- 
> Christian Torres * Desarrollador Web * Guegue.com *
> Celular: +505 84 65 92 62 * Loving of the Programming


Re: Filters

Posted by Christian Torres <ch...@gmail.com>.
Mmmm...

According with this doc http://wiki.apache.org/cassandra/API#get_slice that
a developer mailed to me It's possible!!

I sent you as reference

On Tue, Apr 20, 2010 at 11:17 AM, Mark Jones <MJ...@imagehawk.com> wrote:

>  You will have to pull the columns and filter yourself.
>
>
>
> *From:* Christian Torres [mailto:chtorrez@gmail.com]
> *Sent:* Tuesday, April 20, 2010 11:50 AM
> *To:* user@cassandra.apache.org
> *Cc:* dev@cassandra.apache.org
> *Subject:* Filters
>
>
>
> Hello!
>
> Is there any way to make filters (WHEREs) in cassandra? Or I have tomanages to doit
>
> For example:
>
> I have a ColumnFamily with a column in each row whose value is a state...
> Public or Private, so I want to filter all rows that are private and also
> the public ones in other form... Beside in that rows I will have names of
> persons and I'll need to filter by Initials or Complete Lastnames, etc.
>
> *So any idea?*
>
> Regards
>
> --
> Christian Torres * Desarrollador Web * Guegue.com *
> Celular: +505 84 65 92 62 * Loving of the Programming
>



-- 
Christian Torres * Desarrollador Web * Guegue.com *
Celular: +505 84 65 92 62 * Loving of the Programming

RE: Filters

Posted by Mark Jones <MJ...@imagehawk.com>.
You will have to pull the columns and filter yourself.

From: Christian Torres [mailto:chtorrez@gmail.com]
Sent: Tuesday, April 20, 2010 11:50 AM
To: user@cassandra.apache.org
Cc: dev@cassandra.apache.org
Subject: Filters

Hello!

Is there any way to make filters (WHEREs) in cassandra? Or I have to manages to do it

For example:

I have a ColumnFamily with a column in each row whose value is a state... Public or Private, so I want to filter all rows that are private and also the public ones in other form... Beside in that rows I will have names of persons and I'll need to filter by Initials or Complete Lastnames, etc.

So any idea?

Regards

--
Christian Torres * Desarrollador Web * Guegue.com *
Celular: +505 84 65 92 62 * Loving of the Programming

Re: Filters

Posted by Christian Torres <ch...@gmail.com>.
Thanks a lot!!

On Tue, Apr 20, 2010 at 10:58 AM, Roger Schildmeijer <schildmeijer@gmail.com
> wrote:

> http://wiki.apache.org/cassandra/API#get_slice
>
> // Roger Schildmeijer
> On 20 apr 2010, at 18.50em, Christian Torres wrote:
>
> > Hello!
> >
> > Is there any way to make filters (WHEREs) in cassandra? Or I have to
> manages
> > to do it
> >
> > For example:
> >
> > I have a ColumnFamily with a column in each row whose value is a state...
> > Public or Private, so I want to filter all rows that are private and also
> > the public ones in other form... Beside in that rows I will have names of
> > persons and I'll need to filter by Initials or Complete Lastnames, etc.
> >
> > *So any idea?*
> >
> > Regards
> >
> > --
> > Christian Torres * Desarrollador Web * Guegue.com *
> > Celular: +505 84 65 92 62 * Loving of the Programming
>
>


-- 
Christian Torres * Desarrollador Web * Guegue.com *
Celular: +505 84 65 92 62 * Loving of the Programming

Re: Filters

Posted by Roger Schildmeijer <sc...@gmail.com>.
http://wiki.apache.org/cassandra/API#get_slice

// Roger Schildmeijer
On 20 apr 2010, at 18.50em, Christian Torres wrote:

> Hello!
> 
> Is there any way to make filters (WHEREs) in cassandra? Or I have to manages
> to do it
> 
> For example:
> 
> I have a ColumnFamily with a column in each row whose value is a state...
> Public or Private, so I want to filter all rows that are private and also
> the public ones in other form... Beside in that rows I will have names of
> persons and I'll need to filter by Initials or Complete Lastnames, etc.
> 
> *So any idea?*
> 
> Regards
> 
> -- 
> Christian Torres * Desarrollador Web * Guegue.com *
> Celular: +505 84 65 92 62 * Loving of the Programming