incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Lebresne <sylv...@datastax.com>
Subject Re: is this correct, thrift unportable to CQL3Š.
Date Tue, 24 Sep 2013 13:32:31 GMT
Short answer: not, this is not correct.

Longer answer: what you call "null" is actually an empty value (which is
*not* the same thing, unless you consider an empty string is the same thing
than a null string). As it happens, C* always an empty value as a valid
value for any type and that's true of both thrift and CQL3. What is true is
that CQL3 discourage the use of empty values for type for which it doesn't
particularly make sense (integers typically) by not having a particular
easy to use syntax to input them. But that's supported nonetheless. If you
use a prepared statement for instance (where you send values already
serialized), nothing will prevent you from sending an empty value. Even if
you don't want to use a prepared statement, CQL3 has conversion functions (
http://cassandra.apache.org/doc/cql3/CQL.html#blobFun) that allows to do it
(for instance, "blobAsInt(0x)" will be an empty int value).

--
Sylvain



On Tue, Sep 24, 2013 at 2:36 PM, Hiller, Dean <Dean.Hiller@nrel.gov> wrote:

> Many applications in thrift use the wide row with composite column name
> and as an example, let's say golf score for instance and we end up with
> golf score : pk like so
>
> null : pk56
> null : pk45
> 89 : pk90
> 89: pk87
> 90: pk101
> 95: pk17
>
> Notice that there are some who do not have a golf score(zero would not
> quite make sense and would be interpreted as a golf score).  I am hearing
> from this post if they are correct that this is not portable to CQL3???  Is
> this true?
> http://stackoverflow.com/questions/18963248/how-can-i-have-null-column-value-for-a-composite-key-column-in-cql3
>
> (This sounds like a major deficit to me as the wide row now can only be
> used where actual values exist?????).  Is it possible to port this pattern
> to CQL3?
>
> Thanks,
> Dean
>
>
>

Mime
View raw message