Query: Convert Entity comparison with null to comparison on key properties #6730
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue here:
We need to filter on qsre not null. But since it is not being materialized the value comes from the valuebuffer.
ValueBuffer
is tricky object here. When we use a composite shaper, the value buffer has values but we don't know corresponding value of particular qsre to compare it to null. And when it is valuebuffer for particular qsre only then_values
becomes null instead of null value inside value buffer.For SqlServer, which flattens query, we use composite shaper, we can translate such filters to Sql via entity equality rewriting.
For SQLite & InMemory where we generate different queries we need to guard against,
_values
in value buffer being null instead of actual value.built on top of #6706
Resolves #6636