Skip to content

Commit 1f82f93

Browse files
committed
More spec tests
1 parent dc5c91e commit 1f82f93

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

x-pack/plugin/esql/qa/testFixtures/src/main/resources/lookup-join.csv-spec

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ emp_no:integer | language_code:integer | language_name:keyword
146146

147147
multipleLookupsAndProjects
148148
required_capability: join_lookup_v12
149-
# TODO: this test, but with a lookup index that has multiple matches per row to show the first LOOKUP's effect, too.
150149

151150
FROM employees
152151
| KEEP languages, emp_no
@@ -167,6 +166,44 @@ languages:integer | emp_no:integer | language_code:integer | language_name:keywo
167166
1 | 10005 | 1 | English
168167
;
169168

169+
multipleLookupsAndProjectsNonUnique
170+
required_capability: join_lookup_v12
171+
172+
FROM employees
173+
| KEEP languages, emp_no
174+
| EVAL language_code = languages
175+
# this lookup contributes 0 fields in the end, but it contributes rows via multiple matches
176+
| LOOKUP JOIN languages_lookup_non_unique_key ON language_code
177+
| RENAME language_name AS foo
178+
| LOOKUP JOIN languages_lookup ON language_code
179+
| DROP foo, country, country.keyword
180+
| SORT emp_no
181+
| LIMIT 5
182+
;
183+
184+
languages:integer | emp_no:integer | language_code:integer | language_name:keyword
185+
2 | 10001 | 2 | French
186+
2 | 10001 | 2 | French
187+
2 | 10001 | 2 | French
188+
5 | 10002 | 5 | null
189+
4 | 10003 | 4 | German
190+
;
191+
192+
projectsWithShadowingAfterPushdown
193+
required_capability: join_lookup_v12
194+
195+
FROM languages_lookup
196+
| WHERE language_code == 4
197+
# not shadowed - unless the rename would happen after the lookup
198+
| RENAME language_name AS original_language_name
199+
| LOOKUP JOIN languages_lookup_non_unique_key ON language_code
200+
| DROP country*
201+
;
202+
203+
language_code:integer | original_language_name:keyword | language_name:keyword
204+
4 | German | Quenya
205+
;
206+
170207
###########################################################################
171208
# multiple match behavior with languages_lookup_non_unique_key index
172209
###########################################################################

0 commit comments

Comments
 (0)