On Mon, Oct 27, 2014 at 11:05 AM, Jens Rantil <jens.ran...@tink.se> wrote:

>  Tyler,
>
> I see. That explains it. Any chance you might know how the Datastax Java
> driver behaves for this (odd) case?
>

The Row.getInt() method will do as for nulls and return 0 (though of
course, the Row.isNull() method will return false). If you want to
explicitely check if it's an empty value, you'll have to use
getBytesUnsafe(). Long story short, unless you like suffering for no
reason, don't insert empty values for types for which it doesn't make sense.

--
Sylvain



>
> Cheers,
> Jens
>
> ——— Jens Rantil Backend engineer Tink AB Email: jens.ran...@tink.se
> Phone: +46 708 84 18 32 Web: www.tink.se Facebook Linkedin Twitter
>
> On Friday, Oct 24, 2014 at 6:24 pm, Tyler Hobbs <ty...@datastax.com>,
> wrote:
>
>>
>> On Fri, Oct 24, 2014 at 6:38 AM, Jens Rantil <jens.ran...@tink.se> wrote:
>>
>>>
>>> Just to clarify, I am seeing three types of output for an int field.
>>> It’s either:
>>>  * Empty output. Nothing. Nil. Also ‘’.
>>>  * An integer written in green. Regexp: [0-9]+
>>>  * Explicitly ‘null’ written in red letters.
>>>
>>
>>  Some types (including ints) accept an empty string/ByteBuffer as a
>> valid value.  This is distinct from null, or no cell being present.  This
>> behavior is primarily a legacy from the Thrift days.
>>
>> --
>> Tyler Hobbs
>> DataStax <http://datastax.com/>
>>
>

Reply via email to