Skip to content

Commit 14a7350

Browse files
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.
1 parent e0b6a61 commit 14a7350

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

+33
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,19 @@ setup:
6767
type: long
6868
color:
6969
type: keyword
70+
- do:
71+
indices.create:
72+
index: test-lookup-no-key
73+
body:
74+
settings:
75+
index:
76+
mode: lookup
77+
mappings:
78+
properties:
79+
no-key:
80+
type: long
81+
color:
82+
type: keyword
7083
- do:
7184
indices.update_aliases:
7285
body:
@@ -120,6 +133,15 @@ setup:
120133
- { "key": 2, "color": "yellow" }
121134
- { "index": { } }
122135
- { "key": [0, 1, 2], "color": "green" }
136+
- do:
137+
bulk:
138+
index: "test-lookup-no-key"
139+
refresh: true
140+
body:
141+
- { "index": { } }
142+
- { "no-key": 1, "color": "cyan" }
143+
- { "index": { } }
144+
- { "no-key": 2, "color": "yellow" }
123145

124146
---
125147
basic:
@@ -281,3 +303,14 @@ mv-on-query:
281303
- match: {values.0: [[0, 1, 2], null]}
282304
- match: {values.1: [1, "cyan"]}
283305
- match: {values.2: [2, "yellow"]}
306+
307+
---
308+
lookup-no-key:
309+
- do:
310+
esql.query:
311+
body:
312+
query: 'FROM test | LOOKUP JOIN test-lookup-no-key ON key | KEEP key, color'
313+
catch: "bad_request"
314+
315+
- match: { error.type: "verification_exception" }
316+
- contains: { error.reason: "Unknown column [key] in right side of join" }

0 commit comments

Comments
 (0)