Skip to content

Commit 5144975

Browse files
committed
Add missing pieces
1 parent cde8493 commit 5144975

File tree

3 files changed

+20
-17
lines changed

3 files changed

+20
-17
lines changed
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// TODO: re-enable the commented tests once the Join functionality stabilizes
33
//
44

5-
maxOfInt-Ignore
5+
maxOfInt
66
required_capability: join_planning_v1
77
// tag::max-languages[]
88
FROM employees
@@ -57,7 +57,7 @@ emp_no:integer | avg_worked_seconds:long | gender:keyword | max_avg_worked_secon
5757
10030 | 394597613 | M | 394597613
5858
;
5959

60-
maxOfLong-Ignore
60+
maxOfLong
6161
required_capability: join_planning_v1
6262

6363
FROM employees
@@ -112,7 +112,7 @@ emp_no:integer | avg_worked_seconds:long | last_name:keyword | l:keyword | max_a
112112
10087 | 305782871 | Eugenio | E | 305782871
113113
;
114114

115-
maxOfLongByCalculatedDroppedKeyword
115+
maxOfLongByCalculatedDroppedKeyword-Ignore
116116
required_capability: join_planning_v1
117117

118118
FROM employees
@@ -205,7 +205,7 @@ emp_no:integer | languages:integer | avg_worked_seconds:long | gender:keyword |
205205
10007 | 4 | 393084805 | F | 2.863684210555556E8 | 5
206206
;
207207

208-
byMultivaluedSimple
208+
byMultivaluedSimple-Ignore
209209
required_capability: join_planning_v1
210210

211211
// tag::mv-group[]
@@ -223,7 +223,7 @@ abbrev:keyword | type:keyword | scalerank:integer | min_scalerank:integer
223223
// end::mv-group-result[]
224224
;
225225

226-
byMultivaluedMvExpand
226+
byMultivaluedMvExpand-Ignore
227227
required_capability: join_planning_v1
228228

229229
// tag::mv-expand[]
@@ -243,7 +243,7 @@ abbrev:keyword | type:keyword | scalerank:integer | min_scalerank:integer
243243
// end::mv-expand-result[]
244244
;
245245

246-
byMvExpand
246+
byMvExpand-Ignore
247247
required_capability: join_planning_v1
248248

249249
// tag::extreme-airports[]
@@ -307,7 +307,7 @@ count:long | country:keyword | avg:double
307307
17 | United Kingdom | 4.455
308308
;
309309

310-
afterWhere
310+
afterWhere-Ignore
311311
required_capability: join_planning_v1
312312

313313
FROM airports
@@ -330,7 +330,7 @@ required_capability: join_planning_v1
330330

331331
FROM airports
332332
| RENAME scalerank AS int
333-
| LOOKUP int_number_names ON int
333+
| LOOKUP JOIN int_number_names ON int
334334
| RENAME name as scalerank
335335
| DROP int
336336
| INLINESTATS count=COUNT(*) BY scalerank
@@ -366,7 +366,7 @@ abbrev:keyword | city:keyword | region:text | "COUNT(*)":long
366366
FUK | Fukuoka | 中央区 | 2
367367
;
368368

369-
beforeStats-Ignore
369+
beforeStats
370370
required_capability: join_planning_v1
371371

372372
FROM airports
@@ -379,7 +379,7 @@ northern:long | southern:long
379379
520 | 371
380380
;
381381

382-
beforeKeepSort
382+
beforeKeepSort-Ignore
383383
required_capability: join_planning_v1
384384

385385
FROM employees
@@ -394,7 +394,7 @@ emp_no:integer | languages:integer | max_salary:integer
394394
10003 | 4 | 74572
395395
;
396396

397-
beforeKeepWhere
397+
beforeKeepWhere-Ignore
398398
required_capability: join_planning_v1
399399

400400
FROM employees
@@ -537,7 +537,7 @@ emp_no:integer | one:integer
537537
10005 | 1
538538
;
539539

540-
percentile-Ignore
540+
percentile
541541
required_capability: join_planning_v1
542542

543543
FROM employees

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/join/InlineJoin.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@
1616
import org.elasticsearch.xpack.esql.core.expression.Literal;
1717
import org.elasticsearch.xpack.esql.core.tree.NodeInfo;
1818
import org.elasticsearch.xpack.esql.core.tree.Source;
19-
import org.elasticsearch.xpack.esql.core.util.CollectionUtils;
2019
import org.elasticsearch.xpack.esql.io.stream.PlanStreamInput;
20+
import org.elasticsearch.xpack.esql.plan.logical.Eval;
2121
import org.elasticsearch.xpack.esql.plan.logical.LogicalPlan;
22-
import org.elasticsearch.xpack.esql.plan.logical.Project;
2322
import org.elasticsearch.xpack.esql.plan.logical.UnaryPlan;
2423
import org.elasticsearch.xpack.esql.plan.logical.local.LocalRelation;
2524

@@ -71,10 +70,9 @@ public static LogicalPlan inlineData(InlineJoin target, LocalRelation data) {
7170
List<Alias> aliases = new ArrayList<>(schema.size());
7271
for (int i = 0; i < schema.size(); i++) {
7372
Attribute attr = schema.get(i);
74-
aliases.add(new Alias(attr.source(), attr.name(), Literal.of(attr, BlockUtils.toJavaObject(blocks[i], 0))));
73+
aliases.add(new Alias(attr.source(), attr.name(), Literal.of(attr, BlockUtils.toJavaObject(blocks[i], 0)), attr.id()));
7574
}
76-
LogicalPlan left = target.left();
77-
return new Project(target.source(), left, CollectionUtils.combine(left.output(), aliases));
75+
return new Eval(target.source(), target.left(), aliases);
7876
} else {
7977
return target.replaceRight(data);
8078
}

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/planner/mapper/Mapper.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.elasticsearch.xpack.esql.plan.logical.OrderBy;
2323
import org.elasticsearch.xpack.esql.plan.logical.TopN;
2424
import org.elasticsearch.xpack.esql.plan.logical.UnaryPlan;
25+
import org.elasticsearch.xpack.esql.plan.logical.join.InlineJoin;
2526
import org.elasticsearch.xpack.esql.plan.logical.join.Join;
2627
import org.elasticsearch.xpack.esql.plan.logical.join.JoinConfig;
2728
import org.elasticsearch.xpack.esql.plan.logical.join.JoinTypes;
@@ -178,6 +179,10 @@ private PhysicalPlan mapBinary(BinaryPlan bp) {
178179
throw new EsqlIllegalArgumentException("unsupported join type [" + config.type() + "]");
179180
}
180181

182+
if (join instanceof InlineJoin) {
183+
return new FragmentExec(bp);
184+
}
185+
181186
PhysicalPlan left = map(bp.left());
182187

183188
// only broadcast joins supported for now - hence push down as a streaming operator

0 commit comments

Comments
 (0)