forked from apache/geode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GEODE-9004: Align results of queries with and without map indexes (ap…
…ache#6279) * GEODE-9004: Align results of queries with and without map indexes Queries in which map fields are involved in the condition, sometimes do not return the same entries if map indexes are used, compared to when map indexes are not used. Differences were found when the condition on the map field was of type '!=' and also when the condition on the map field was comparing the value with null. Example1: Running a query with the following condition: positions['SUN'] = null in a region with the following entries: entry1.positions=null entry2.positions={'a'=>'b'} entry3.positions={'SUN'=>null} - will return entry1 and entry3 if there are no indexes defined. - will return no entries if the following index is defined: positions['SUN','c'] - will return entry3 if the following index is defined: positions[*] Example2: Running a query with the following condition: positions['SUN'] != '3' in a region with the following entries: entry1.positions=null entry2.positions={'a'=>'b'} entry3.positions={'SUN'=>'4'} entry4.positions={'SUN'=>'3'} entry5.positions={'SUN'=>null} - will return all entries except for entry4 if: there are no indexes defined. - will return entry3 if the following index is defined: positions['SUN','c'] - will return entry3 and entry5 if the following index is defined: positions[*] In order to have the same results for these queries no matter if indexes are used, the following changes have been made: - When using compact map indexes or map indexes an index entry will be created for every entry added to the region even if the entry does not contain the indexed map (the map is null) or it does not contain any of the indexed keys. The above will not apply to indexes of type "allkeys" (e.g. positions[*]). - As a consequence of the statement above about indexes of type "allkeys", when the index configured is of "allkeys" type and the query is of type "!=" (e.g. positions['SUN'] != "3" or the query is comparing against a null value (e.g. positions['SUN'] = null) the index will not be used. This is a limitation of this solution as allowing the index to be used in this case would require bigger and more complex changes that have not been considered in this solution. * GEODE-9004: Fix stats for number of keys in compact map indexes * GEODE-9004: Fix failing test cases polluted by other test cases changing a System Property * GEODE-9004: Changes after review and some refactorings * GEODE-9004: Add documentation changes * GEODE-9004: Small change in doc. after review
- Loading branch information
1 parent
95c27da
commit 884d399
Showing
13 changed files
with
581 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.