Skip to content

Cosmos: Expand checks against null values for nested properties to first check parents for null #17746

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

Open
divega opened this issue Sep 10, 2019 · 0 comments

Comments

@divega
Copy link
Contributor

divega commented Sep 10, 2019

The full context is described in #13131 about dealing with missing property values. Creating this separate issue to track priorities separately.

In general we have chosen not to equate undefined and null values. Customers using the Cosmos DB provider will need to be aware of how to deal with missing values in their databases.

There is however one specific scenario in which we decided to compensate to make missing values more seamless: We will expand null comparisons for nested properties to compensate. For example, c.Address.City == address will expand to c.Address == null OR c.Address.City == null when address is equal to null. If we don't do this, and c.Address is null, the check for c.Address.City == address will not succeed and the query will not return that row.

Notice that we are not proposing to check for EF.Functions.IsDefined(c.Addresss) but for c.Address == null. That is coherent with not conflating undefined with null values.

A good way to think about this proposal is that we do it to simulate how null propagation would work in many other databases to make the experience more predictable.

cc @AndriySvyryd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants