cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Stupp (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-7206) UDT - allow null / non-existant attributes
Date Fri, 23 May 2014 09:05:02 GMT

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

Robert Stupp commented on CASSANDRA-7206:
-----------------------------------------

Not sure whether I've read the patch correctly:
The validation code in {{UserTypes}} still checks for field value {{< FBUtilities.MAX_UNSIGNED_SHORT}},
but serialization format has changed to use 32 bit int for field length.
{code}
"Value for field %s is too long. User type fields are limited to %d bytes but %d bytes provided"
{code}

> UDT - allow null / non-existant attributes
> ------------------------------------------
>
>                 Key: CASSANDRA-7206
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7206
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Robert Stupp
>            Assignee: Sylvain Lebresne
>             Fix For: 2.1 rc1
>
>         Attachments: 7206.txt
>
>
> C* 2.1 CQL User-Defined-Types are really fine and useful.
> But it lacks the possibility to omit attributes or set them to null.
> Would be great to have the possibility to create UDT "instances" with some attributes
missing.
> Also changing the UDT definition (for example: {{alter type add new_attr}}) will break
running applications that rely on the "previous" definition of the UDT.
> For exmple:
> {code}
> CREATE TYPE foo (
>    attr_one text,
>    attr_two int );
> CREATE TABLE bar (
>    id int,
>    comp foo );
> {code}
> {code}
> INSERT INTO bar (id, com) VALUES (1, {attr_one: 'cassandra', attr_two: 2});
> {code}
> works
> {code}
> INSERT INTO bar (id, com) VALUES (1, {attr_one: 'cassandra'});
> {code}
> does not work
> {code}
> ALTER TYPE foo ADD attr_three timestamp;
> {code}
> {code}
> INSERT INTO bar (id, com) VALUES (1, {attr_one: 'cassandra', attr_two: 2});
> {code}
> will no longer work (missing attribute)



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message