cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Boris Babic <bo...@icloud.com>
Subject Re: Copy from CSV on OS X problem with varint values <= -2^63
Date Tue, 04 Apr 2017 10:12:16 GMT
Thanks Stefania, going from memory don't think I noticed this on windows but haven't got a
machine handy to test it on at the moment. 

> On Apr 4, 2017, at 19:44, Stefania Alborghetti <stefania.alborghetti@datastax.com>
wrote:
> 
> I've reproduced the same problem on Linux, and I've opened CASSANDRA-13408. As a workaround,
disable prepared statements and it will work (WITH HEADER = TRUE AND PREPAREDSTATEMENTS =
False).
> 
>> On Tue, Apr 4, 2017 at 5:02 PM, Boris Babic <bori5@icloud.com> wrote:
>> 
>> On Apr 4, 2017, at 7:00 PM, Boris Babic <bori5@icloud.com> wrote:
>> 
>> Hi
>> 
>> I’m testing the write of various datatypes on OS X for fun running cassandra 3.10
on a single laptop instance, and from what i can see varint should map to java.math.BigInteger
and have no problems with Long.MIN_VALE , -9223372036854775808, but i can’t see what I’m
doing wrong.
>> 
>> cqlsh: 5.0.1
>> cassandra 3.10
>> osx el capitan.
>> 
>> data.csv:
>> 
>> id,varint
>> -2147483648,-9223372036854775808
>> 2147483647,9223372036854775807
>> 
>> COPY mykeyspace.data (id,varint) FROM 'data.csv' WITH HEADER=true;
>> 
>>       Failed to make batch statement: Received an argument of invalid type for column
"varint". Expected: <class 'cassandra.cqltypes.IntegerType'>, Got: <type 'int'>;
(descriptor 'bit_length' requires a 'int' object but received a 'long’)
>> 
>> If I directly type a similar insert in cqlsh no such problem occurs, in fact I can
make the value many orders of magnitude less and all is fine.
>> 
>> cqlsh> insert into mykeyspace.data (id,varint) values(1,-9223372036854775808898989898)
;
>> 
>> Had not observed this before on other OS, is this something todo with the way the
copy from parser is interpreting varint for values <= -2^63 ?
>> 
>> Thanks for any input
>> Boris
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
> 
> 
> 
> -- 
> 
> STEFANIA ALBORGHETTI
> Software engineer | +852 6114 9265 | stefania.alborghetti@datastax.com
> 
> 
> 
> 

Mime
View raw message