cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastian Estevez <sebastian.este...@datastax.com>
Subject Re: Are updates on map columns causing tombstones?
Date Tue, 12 Jul 2016 13:22:48 GMT
I did a short write-up on this.

http://www.sestevez.com/on-cassandra-collections-updates-and-tombstones/

all the best,

Sebastián
On Jul 11, 2016 4:22 PM, "Alain RODRIGUEZ" <arodrime@gmail.com> wrote:

> Hi Jan,
>
>
>> when I replace the content of a map-valued column (when I replace the
>> complete map), will this create tombstones for those map entries that are
>> not present in the new map?
>
>
> This is almost correct, I would be more precise and say that it will
> create a range tombstone on this map, and create a new one. No merge. To
> have the behaviour you described, you have to set the map though:
>
> // Updating (or inserting)
> UPDATE users SET favs['author'] = 'Ed Poe' WHERE id = 'jsmith'
> UPDATE users SET favs = favs -  { 'movie' : 'Cassablanca' } WHERE id = 'jsmith'
>
> ==> Tombstone on some specific cells or adding a value in a collection. Previous data
is kept.
>
> *Instead of*
>
> // Updating (or inserting)
>
> INSERT INTO users (id, given, surname, favs) VALUES ('jsmith', 'John', 'Smith', { 'fruit'
: 'apple', 'band' : 'Beatles' })
> UPDATE users SET favs = { 'movie' : 'Cassablanca' } WHERE id = 'jsmith'
>
> ==> Range tombstone on previous collection (the whole thing). Tombstone + new write
(no merge). No explicit delete but dropping data this can be unexpected and hard to troubleshot.
>
> C*heers,
>
> -----------------------
> Alain Rodriguez - alain@thelastpickle.com
> France
>
> The Last Pickle - Apache Cassandra Consultinghttp://www.thelastpickle.com
>
> 2016-07-11 16:51 GMT+02:00 Matthias Niehoff <
> matthias.niehoff@codecentric.de>:
>
>> Hi,
>>
>> it depends.
>> - If you defined the type as a frozen<map> there will not be tombstone,
>> as the map is stored as one binary blob. The update is handled as a normal
>> upsert.
>> - If you do not use the frozen keyword you are right. There will be range
>> tombstones for all columns that have been deleted or updated.
>>
>> 2016-07-11 16:16 GMT+02:00 Jan Algermissen <algermissen1971@icloud.com>:
>>
>>> Hi,
>>>
>>> when I replace the content of a map-valued column (when I replace the
>>> complete map), will this create tombstones for those map entries that are
>>> not present in the new map?
>>>
>>> My expectation is 'yes', because the map is laid out as normal columns
>>> internally so keys not in the new map should lead to a delete.
>>>
>>> Is that correct?
>>>
>>> Jan
>>>
>>
>>
>>
>> --
>> Matthias Niehoff | IT-Consultant | Agile Software Factory  | Consulting
>> codecentric AG | Zeppelinstr 2 | 76185 Karlsruhe | Deutschland
>> tel: +49 (0) 721.9595-681 | fax: +49 (0) 721.9595-666 | mobil: +49 (0)
>> 172.1702676
>> www.codecentric.de | blog.codecentric.de | www.meettheexperts.de |
>> www.more4fi.de
>>
>> Sitz der Gesellschaft: Solingen | HRB 25917| Amtsgericht Wuppertal
>> Vorstand: Michael Hochgürtel . Mirko Novakovic . Rainer Vehns
>> Aufsichtsrat: Patric Fedlmeier (Vorsitzender) . Klaus Jäger . Jürgen
>> Schütz
>>
>> Diese E-Mail einschließlich evtl. beigefügter Dateien enthält
>> vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht
>> der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben,
>> informieren Sie bitte sofort den Absender und löschen Sie diese E-Mail und
>> evtl. beigefügter Dateien umgehend. Das unerlaubte Kopieren, Nutzen oder
>> Öffnen evtl. beigefügter Dateien sowie die unbefugte Weitergabe dieser
>> E-Mail ist nicht gestattet
>>
>
>

Mime
View raw message