cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DuyHai Doan <doanduy...@gmail.com>
Subject Re: How is null handled in terms of storage when using static schemas?
Date Sat, 21 Jun 2014 13:20:12 GMT
With CQL3 semantics, setting a column to "null" means deleting it (e.g.
creating a tombstone column). It is different from having a  "non-null
column name and a null cell".


On Sat, Jun 21, 2014 at 12:17 PM, Jens Rantil <jens.rantil@tink.se> wrote:

> Hi Kevin,
>
> I can explain as I've understood things. Experts, let me know if I got
> this wrong! Here you go:
>
> Simplified, when using a CQL-created table the underlying clustering key
> for your columns is actually (YOUR_CLUSTERING_KEY, columnname). Because of
> this, setting YOURCOLUMN to null, simply deletes the key/value with key
> (YOUR_CLUSTERING_KEY, YOURCOLUMN).
>
> To be able to still set meta data on a row-to-row-basis (TTL, for
> example), as well as supporting empty rows (ie. all-nulls), every row also
> has a row marker with key (YOUR_CLUSTERING_KEY, ROW_MARKER). Conceptually,
> you could almost see ROW_MARKER as a hidden non-nullable column in your
> table.
>
> Cheers,
> Jens
>
>
> On Sat, Jun 21, 2014 at 5:13 AM, Kevin Burton <burton@spinn3r.com> wrote:
>
>> Let's say we have a table like with just an integer primary key named ID
>> and a text column named VALUE…
>>
>>
>> if we set value to 0, "hello world"
>>
>> … obviously , that's a normal value.
>>
>> However, what happens if we update it with
>>
>> 0, null
>>
>> … how is the 'null' stored?
>>
>> I couldn't find any documentation for this anywhere.
>>
>> The new null supersedes the older value of "hello world" so I assume it
>> has to write it into an SSTable before both SSTables are compacted.
>>
>> --
>>
>> Founder/CEO Spinn3r.com
>> Location: *San Francisco, CA*
>> Skype: *burtonator*
>> blog: http://burtonator.wordpress.com
>> … or check out my Google+ profile
>> <https://plus.google.com/102718274791889610666/posts>
>> <http://spinn3r.com>
>> War is peace. Freedom is slavery. Ignorance is strength. Corporations are
>> people.
>>
>>
>

Mime
View raw message