Add support for nested exclusive predicates with JSON index; fix semantics for exclusive predicates #13139
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.
AND
/OR
) exclusive predicates (NOT IN
,!=
,IS NULL
) with theJSON_MATCH
filter operator."$[*].key2" = 1
, but not"$[*].key2" != 2
for example."$[0].key2" != 2
which is counterintuitive since the object doesn’t containkey2
at all.[*]
now means the same for both exclusive (NOT IN
,!=
) and inclusive predicates, and documents where a key doesn't exist aren't matched for the exclusive predicatesNOT IN
,!=
. It also adds support for nested exclusive predicates.NOT IN
,!=
make use of similar logic to the implementation for the regex and range predicates (Enhance json index to support regexp and range predicate evaluation #12568).IS NULL
predicate continues to remain an "exclusive" predicate and won't be supported for use in nested predicates as of now, because there isn't a straightforward way to efficiently treat it as an inclusive predicate (i.e., without scanning all the flattened docs). We can't simply flip the flattened doc ID result for the correspondingIS NOT NULL
predicate either as that leads to incorrect results whendisableCrossArrayUnnest
is set totrue
, as well as certain other scenarios involving chained array accesses and wildcard accesses.feature
,backward-incompat
,release-notes