...
With this history, upgrading a tuple (1, "John", "Doe")
of version 1 to version 4 means erasing columns lastname
and taxid
and adding columns residence
with default "GB"
and lastname
(the column is returned back) with default "N/A"
resulting in tuple (1, "John", "GB", "N/A")
.
...
For example, let's say we have a schema PERSON (id INT, name VARCHAR (32), lastname VARCHAR (32), residence VARCHAR (2), taxid INT)
. Each tuple of this schema can be deserialized into the following classes:
...
One of the important benefits of binary objects was the ability to store objects with different sets of fields in a single cache. We can accommodate for a very similar behavior in the schema-first approach.
When an object is inserted into a table, we attempt to 'fit' object fields to the schema columns. If a Java object has some extra fields which are not present in the current schema, the schema is automatically updated to store additional extra fields that are present in the object.
On the other hand, if an object has fewer fields than the current schema, the schema is not updated auto(such scenario usually means that an update is executed from an outdated client which did not yet receive a proper object class version). In other words, columns are never dropped during automatic schema evolution; a column can only be dropped by an explicit user command.
n/a
...