[ 
https://issues.apache.org/jira/browse/CASSANDRA-3031?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13096625#comment-13096625
 ] 

Radim Kolar commented on CASSANDRA-3031:
----------------------------------------

with this patch applied new CF created via cqlsh are using new 
org.apache.cassandra.db.marshal.IntType type for int columns. Old applications 
using CF created with old int type are unaffected. In python returned type to 
old apps is int or long depending on value inserted. Patch is fully backward 
compatible, i havent discovered any incompatibility yet.

in CQL we should have types:
int (new IntType), Long (LongType) and number/varint (IntegerType). Better to 
do changes early while CQL is not widely used.

IntType is needed:
*  for type safety to applications loading data from cassandra to int type 
variable to make sure that input does not overflow. Unlike other nosql 
databases cassandra can have optional type safety and int4 type is currently 
missing.

* to resolve compatibility issues with applications writing fixed size 4 bytes 
integers to IntegerType. (most hector apps are doing this). These integers can 
not be manipulated using cassandra-cli or read back in applications in python 
or PHP.

> Add 4 byte integer type
> -----------------------
>
>                 Key: CASSANDRA-3031
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3031
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 0.8.4
>         Environment: any
>            Reporter: Radim Kolar
>            Priority: Minor
>              Labels: hector, lhf
>             Fix For: 1.0
>
>         Attachments: apache-cassandra-0.8.4-SNAPSHOT.jar, src.diff, test.diff
>
>
> Cassandra currently lacks support for 4byte fixed size integer data type. 
> Java API Hector and C libcassandra likes to serialize integers as 4 bytes in 
> network order. Problem is that you cant use cassandra-cli to manipulate 
> stored rows. Compatibility with other applications using api following 
> cassandra integer encoding standard is problematic too.
> Because adding new datatype/validator is fairly simple I recommend to add 
> int4 data type. Compatibility with hector is important because it is most 
> used Java cassandra api and lot of applications are using it.
> This problem was discussed several times already 
> http://comments.gmane.org/gmane.comp.db.hector.user/2125
> https://issues.apache.org/jira/browse/CASSANDRA-2585
> It would be nice to have compatibility with cassandra-cli and other 
> applications without rewriting hector apps.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to