-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Columns<Link> when property is Dictionary if links
If a Dictionary property has links as value type, we can use Columns<Link> to handle the links instead of the basic Columns<Dictionary>. This has the effect that when we compare with a single value, we will optimize to use LinksToNode. So we need to make LinksToNode handle the Dictionary case. When we compare with a list of links, we must ensure that the list is converted to a list obj ObjKeys - which is the type that Column<Link> evaluates to.
- Loading branch information
Showing
4 changed files
with
133 additions
and
67 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5040,6 +5040,7 @@ TEST(Parser_DictionaryObjects) | |
|
||
Obj adam = persons->create_object_with_primary_key("adam"); | ||
Obj bernie = persons->create_object_with_primary_key("bernie"); | ||
Obj charlie = persons->create_object_with_primary_key("charlie"); | ||
|
||
Obj astro = dogs->create_object_with_primary_key("astro", {{col_age, 4}}); | ||
Obj pluto = dogs->create_object_with_primary_key("pluto", {{col_age, 5}}); | ||
|
@@ -5055,17 +5056,21 @@ TEST(Parser_DictionaryObjects) | |
bernie_pets.insert("dog1", astro); | ||
bernie_pets.insert("dog2", snoopy); | ||
|
||
auto charlie_pets = charlie.get_dictionary(col_dict); | ||
charlie_pets.insert("dog1", pluto); | ||
|
||
adam.set(col_friend, bernie.get_key()); | ||
bernie.set(col_friend, adam.get_key()); | ||
|
||
auto q = persons->link(col_dict).column<Int>(col_age) > 4; | ||
CHECK_EQUAL(q.count(), 1); | ||
CHECK_EQUAL(q.count(), 2); | ||
q = persons->link(col_friend).link(col_dict).column<Int>(col_age) > 4; | ||
CHECK_EQUAL(q.count(), 1); | ||
|
||
verify_query(test_context, persons, "[email protected] > 4", 1); | ||
verify_query(test_context, persons, "pets.@values == obj('dog', 'pluto')", 1); | ||
verify_query(test_context, persons, "pets.@values == ANY { obj('dog', 'pluto'), obj('dog', 'astro') }", 2); | ||
verify_query(test_context, persons, "[email protected] > 4", 2); | ||
verify_query(test_context, persons, "pets.@values == obj('dog', 'pluto')", 2); | ||
verify_query(test_context, persons, "pets.@values != obj('dog', 'pluto')", 2); | ||
verify_query(test_context, persons, "pets.@values == ANY { obj('dog', 'lady'), obj('dog', 'astro') }", 2); | ||
} | ||
|
||
TEST(Parser_DictionarySorting) | ||
|