问题
if someone has some experience in using UDT (User Defined Types), I would like to understand how the backward compatibility would work.
Say I have the following UDT
CREATE TYPE addr (
street1 text,
zip text,
state text
);
If I modify "addr" UDT to have a couple of more attributes (say for example zip_code2 int, and name text):
CREATE TYPE addr (
street1 text,
zip text,
state text,
zip_code2 int,
name text
);
how does the older rows that does have these attributes work? Is it even compatible?
Thanks
回答1:
The new UDT definition would be compatible with the old definition. User-defined types can have null values for fields, so if you alter the type definition, all existing values for that type will simply have null values for the added fields.
来源:https://stackoverflow.com/questions/34300141/user-defined-type-udt-behavior-in-cassandra