cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paolo Bernardi <berna...@gmail.com>
Subject Re: Can column type be changed dynamically?
Date Sat, 28 Apr 2012 17:00:51 GMT
Apparently IntegerType is based on Java's BigInteger.

http://git-wip-us.apache.org/repos/asf?p=cassandra.git;a=blob_plain;f=src/java/org/apache/cassandra/db/marshal/IntegerType.java;hb=HEAD

Given the message, I suspect that you got some values between -2^15 and
2^15-1 (the range of a short int) that have been serialized with two bytes.
Any confirmation on this?

If this is true, changing the type like you tried to do might not be so
straightforward.

Paolo
On Apr 27, 2012 6:55 PM, "马超" <hosschao@gmail.com> wrote:

> After I update the column type:
>
> *update column family User with column_metadata = [{column_name : 77,
> validation_class : Int32Type}];*
>
> I can't list the data in User column family:
>
> *list User;*
> *
> *
> *RowKey: 1234*
> *A int is exactly 4 bytes: 2*
>
> Any ideas for this?
>
> Thanks,
>
> 2012/4/27 马超 <hosschao@gmail.com>
>
>> Thanks a lot!
>> I will go ahead~
>>
>>
>> 2012/4/27 Sylvain Lebresne <sylvain@datastax.com>
>>
>>> On Fri, Apr 27, 2012 at 5:26 PM, 马超 <hosschao@gmail.com> wrote:
>>> > Hi all,
>>> >
>>> > I want to change one of my column type from IntegerType to Int32Type
>>> > dynamically. I'm sure all datas in that column are int32 type indeed.
>>> So I
>>> > want changing the column type by:
>>> >
>>> > update column family XXX with column_metadata = [{column_name : 'xxx',
>>> > validation_class : Int32Type}];
>>> >
>>> > Is there any harm to do this?
>>>
>>> There isn't (as long as you're right to be sure of course).
>>>
>>> --
>>> Sylvain
>>>
>>
>>
>

Mime
View raw message