Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3B031110AA for ; Tue, 13 May 2014 21:25:23 +0000 (UTC) Received: (qmail 95539 invoked by uid 500); 13 May 2014 21:25:23 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 95505 invoked by uid 500); 13 May 2014 21:25:23 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 95497 invoked by uid 99); 13 May 2014 21:25:23 -0000 Received: from Unknown (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 May 2014 21:25:23 +0000 Date: Tue, 13 May 2014 21:25:22 +0000 (UTC) From: "Robert Stupp (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-7206) UDT - allow null / non-existant attributes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-7206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13996911#comment-13996911 ] Robert Stupp commented on CASSANDRA-7206: ----------------------------------------- Setting a field to "null" could have the same meaning as "omitting". The possibility to omit a field is essential if the type is extended by adding fields during runtime of an application creates new instances of this UDT. BTW: +1 for CASSANDRA-7209 :) > 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 > > > 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)