Details
-
Improvement
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
None
Description
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:
CREATE TYPE foo ( attr_one text, attr_two int ); CREATE TABLE bar ( id int, comp foo );
INSERT INTO bar (id, com) VALUES (1, {attr_one: 'cassandra', attr_two: 2});
works
INSERT INTO bar (id, com) VALUES (1, {attr_one: 'cassandra'});
does not work
ALTER TYPE foo ADD attr_three timestamp;
INSERT INTO bar (id, com) VALUES (1, {attr_one: 'cassandra', attr_two: 2});
will no longer work (missing attribute)
Attachments
Attachments
Issue Links
- is related to
-
CASSANDRA-7209 Consider changing UDT serialization format before 2.1 release.
-
- Resolved
-
1.
|
cqlsh support for null values in UDT |
|
Resolved | Mikhail Stepura |