Skip to content

Commit

Permalink
Ensure nested field could be used in lookup joins
Browse files Browse the repository at this point in the history
  • Loading branch information
idegtiarenko committed Dec 18, 2024
1 parent dbbcb09 commit 216c667
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ public class CsvTestsDataLoader {
.withSetting("languages_lookup-settings.json");
private static final TestsDataset LANGUAGES_LOOKUP_NON_UNIQUE_KEY = LANGUAGES_LOOKUP.withIndex("languages_lookup_non_unique_key")
.withData("languages_non_unique_key.csv");
private static final TestsDataset LANGUAGES_NESTED_FIELDS = LANGUAGES_LOOKUP.withIndex("languages_nested_fields")
.withData("languages_nested_fields.csv");
private static final TestsDataset ALERTS = new TestsDataset("alerts");
private static final TestsDataset UL_LOGS = new TestsDataset("ul_logs");
private static final TestsDataset SAMPLE_DATA = new TestsDataset("sample_data");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
_id:integer,language.id:integer,language.name:keyword,language.code:keyword
1,1,English,EN
2,2,French,FR
3,3,Spanish,ES
4,4,German,DE
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,28 @@ language_code:integer | language_name:keyword | country:keyword
8 | Mv-Lang2 | Mv-Land2
;

###########################################################################
# nested filed join behavior with languages_nested_fields index
###########################################################################

joinOnNestedField
required_capability: join_lookup_v8

FROM employees
| WHERE 10000 < emp_no AND emp_no < 10005
| EVAL language.id = emp_no % 10
| LOOKUP JOIN languages_nested_fields ON language.id
| SORT emp_no
| KEEP emp_no, language.id, language.name
;

emp_no:integer | language.id:integer | language.name:keyword
10001 | 1 | English
10002 | 2 | French
10003 | 3 | Spanish
10004 | 4 | German
;

###############################################
# Tests with clientips_lookup index
###############################################
Expand Down

0 comments on commit 216c667

Please sign in to comment.