Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Literal null values in inserts/updates causing cell tombstones [DATACASS-420] #589

Closed
spring-projects-issues opened this issue Mar 24, 2017 · 1 comment
Assignees
Labels
in: core Issues in core support type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link

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)

@spring-projects-issues
Copy link
Author

Mark Paluch commented

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core support type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants