cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Ellis <jbel...@gmail.com>
Subject Re: Query on delete a column inside a super column
Date Wed, 07 Jul 2010 14:11:34 GMT
the thrift api allows you to optionally specify column and subcolumn
as well.  no idea how or if phpCassa exposes this though.

On Wed, Jul 7, 2010 at 1:51 AM, Moses Dinakaran
<mosesdinakaran@gmail.com> wrote:
> Hi,
>
> Thanks for the reply,
>
> The remove method
> $cassandraInstance->remove('cache_pages_key_hash', 'hash_1' )
>
> which will remove the whole key, But I don't want to do that, I need to
> remove one column inside that key
>
> Can you please tell me how to use the remove method in this case.
>
>
> Regards,
> Moses.
>
>
> On Wed, Jul 7, 2010 at 12:16 AM, Jonathan Ellis <jbellis@gmail.com> wrote:
>>
>> insert is insert-or-update.  leaving out a column from an update
>> doesn't delete it, you need to use the remove method for that.
>>
>> On Tue, Jul 6, 2010 at 7:41 AM, Moses Dinakaran
>> <mosesdinakaran@gmail.com> wrote:
>> > Hi All,
>> >
>> > I have a query related to deleting a column inside a super column
>> >
>> > The following is my cassandra schema
>> >
>> > [cache_pages_key_hash] => Array
>> >        (
>> >            [hash_1] => Array
>> >                (
>> >                    [1] => 4c330e95195f9
>> >                    [2] => 4c330e951f18b
>> >                    [3] => 4c330e9521f3d
>> >                )
>> >
>> >        )
>> >
>> >
>> > No I wanted to remove the index [1] => 4c330e95195f9 from the
>> > supercolumn [hash_1]
>> >
>> > Through phpCassa I am doing the following
>> >
>> > $updatedRecord   =  array("hash_1" => Array
>> >                                (
>> >                                    2 => "4c330e951f18b"
>> >                                    3 => "4c330e9521f3d"
>> >                               )
>> >                             )
>> >
>> >
>> > $cassandraInstance->insert('cache_pages_key_hash',$updateRecord );
>> >
>> > But while I fetch the record again
>> >
>> > I was getting the original records ie the column 1 is not removed from
>> >
>> >
>> > [cache_pages_key_hash] => Array
>> >        (
>> >            [hash_1] => Array
>> >                (
>> >                    [1] => 4c330e95195f9
>> >                    [2] => 4c330e951f18b
>> >                    [3] => 4c330e9521f3d
>> >                )
>> >
>> >        )
>> >
>> >
>> > But at the same time If I am updating the index 1
>> >
>> > ie
>> > $updateRecord   =  array("hash_1" => Array
>> >                                (
>> >                                   1  => ' able to update'
>> >                                    2 => "4c330e951f18b"
>> >                                    3 => "4c330e9521f3d"
>> >                               )
>> >                             )
>> >
>> > $cassandraInstance->insert('cache_pages_key_hash',$updateRecord );
>> >
>> > The records is being updated, Only problem is that  deleting dosent
>> > happens.
>> >
>> > My question is that is this behavior is expected as explained in the
>> > article
>> > Distributed deletes in the Cassandra database
>> > http://spyced.blogspot.com/2010/02/distributed-deletes-in-cassandra.html
>> >
>> > or I am doing wrong.
>> >
>> >
>> > Thanks,
>> > Moses.
>> >
>>
>>
>>
>> --
>> Jonathan Ellis
>> Project Chair, Apache Cassandra
>> co-founder of Riptano, the source for professional Cassandra support
>> http://riptano.com
>
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com

Mime
View raw message