This issue is caused by the fix for DATACASS-182. Prior to that, the MappingCassandraConverter did not allow inserting literal null values. Now, it does not allow not setting them. Setting literal null values in Cassandra causes cell tombstones which take up space and are detrimental to performance.
Ideally, there would be an option (preferably at the query level) to say whether or not to insert literal null values, because in some instances, as described by DATACASS-182 you do want to insert literal nulls. I would suggest that the default behavior should be to not insert literal nulls though, because in my opinion it would be more of an exception to the rule that you actually want to insert a literal null since (in my experience) you are mostly inserting new records and not updating existing ones. The offending code is in writeInsertFromWrapper
The motivation to implement DATACASS-182 was driven by removing values when updating existing objects. From a Repository perspective, we expect the same property values when loading an object after modification. Inserting null values wasn't really part of that motivation and sneaked into the change. We're going to skip null values on insert and retain null value behavior in UPDATE
Emil Berglind opened DATACASS-420 and commented
This issue is caused by the fix for DATACASS-182. Prior to that, the MappingCassandraConverter did not allow inserting literal null values. Now, it does not allow not setting them. Setting literal null values in Cassandra causes cell tombstones which take up space and are detrimental to performance.
Ideally, there would be an option (preferably at the query level) to say whether or not to insert literal null values, because in some instances, as described by DATACASS-182 you do want to insert literal nulls. I would suggest that the default behavior should be to not insert literal nulls though, because in my opinion it would be more of an exception to the rule that you actually want to insert a literal null since (in my experience) you are mostly inserting new records and not updating existing ones. The offending code is in
writeInsertFromWrapper
Affects: 1.5.1 (Ingalls SR1)
Reference URL: https://stackoverflow.com/questions/42989331/spring-data-cassandra-insert-creating-cell-tombstones
Issue Links:
Referenced from: commits a430e80, 76ab62e
Backported to: 1.5.2 (Ingalls SR2)
The text was updated successfully, but these errors were encountered: