You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Giampaolo (JIRA)" <ji...@apache.org> on 2016/05/10 19:26:12 UTC

[jira] [Commented] (CASSANDRA-11114) Document which type conversions are allowed

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

Giampaolo commented on CASSANDRA-11114:
---------------------------------------

About this issue, I wrote a little [program|https://github.com/giampaolotrapasso/cassandra-type-conversions] to test all possible combinations of type conversion in {{ALTER TABLE}} statement. I run this on 3.4, I will run again with the 3.5/3.6.

I've tried all basic types without considering when the column is a partition key or a clustering column. This is the list of the allowed conversion

||From|To||
|_timestamp_|_bigint_|
|ascii, bigint, boolean, _date_, decimal, double, float, inet, int, _smallint_, _text_, _time_, timestamp, timeuuid, _tinyint_, uuid, varchar, varint|blob|
|_int_|_date_|
|_bigint_|_time_|
|_ascii_, _varchar_|_text_|
|_bigint_|_timestamp_|
|_ascii_, _text_|_varchar_|
|_bigint_, _int_, _timestamp_|_varint_|
|timeuuid|uuid|

It differs a bit from what should be the most updated [documentation|https://docs.datastax.com/en/cql/3.3/cql/cql_reference/cql_data_types_c.html]. I have put in italic what are the additions respect to the mentioned url.

Going to do the same for clustering column, meanwhile any comment on this, if any, is appreciated.





> Document which type conversions are allowed
> -------------------------------------------
>
>                 Key: CASSANDRA-11114
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-11114
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: CQL, Documentation and Website
>            Reporter: Sylvain Lebresne
>            Assignee: Giampaolo
>            Priority: Minor
>              Labels: doc-impacting, lhf
>
> We allow only some type conversion through {{ALTER TABLE}} and type casts, the ones that don't break stuff, but we don't currently document which ones those are. We should add it to http://cassandra.apache.org/doc/cql3/CQL-3.0.html.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)