Skip to content

Commit e4e9cd0

Browse files
[9.0] Additional yaml test for missing join key on right side (#127906) (#128015)
* Additional yaml test for missing join key on right side (#127906) There are some analyser tests for this, but I thought it useful to also have a yaml test for more coverage, since there was temporarily an issue #120189 with this, later fixed in #120617. * Fix mistake in merge
1 parent 2122c59 commit e4e9cd0

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/190_lookup_join.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,19 @@ setup:
4444
type: long
4545
color:
4646
type: keyword
47+
- do:
48+
indices.create:
49+
index: test-lookup-no-key
50+
body:
51+
settings:
52+
index:
53+
mode: lookup
54+
mappings:
55+
properties:
56+
no-key:
57+
type: long
58+
color:
59+
type: keyword
4760
- do:
4861
indices.update_aliases:
4962
body:
@@ -75,6 +88,15 @@ setup:
7588
- { "key": 1, "color": "cyan" }
7689
- { "index": { } }
7790
- { "key": 2, "color": "yellow" }
91+
- do:
92+
bulk:
93+
index: "test-lookup-no-key"
94+
refresh: true
95+
body:
96+
- { "index": { } }
97+
- { "no-key": 1, "color": "cyan" }
98+
- { "index": { } }
99+
- { "no-key": 2, "color": "yellow" }
78100

79101
---
80102
basic:
@@ -200,3 +222,14 @@ pattern-single:
200222

201223
- match: { error.type: "parsing_exception" }
202224
- contains: { error.reason: "line 1:36: invalid index pattern [test-lookup-1*], * is not allowed in LOOKUP JOIN" }
225+
226+
---
227+
lookup-no-key:
228+
- do:
229+
esql.query:
230+
body:
231+
query: 'FROM test | LOOKUP JOIN test-lookup-no-key ON key | KEEP key, color'
232+
catch: "bad_request"
233+
234+
- match: { error.type: "verification_exception" }
235+
- contains: { error.reason: "Unknown column [key] in right side of join" }

0 commit comments

Comments
 (0)