Skip to content

Commit 94da34b

Browse files
Update
1 parent 82672be commit 94da34b

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/session/FieldNameUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public static PreAnalysisResult resolveFieldNames(LogicalPlan parsed, EnrichReso
109109
var canRemoveAliases = new Holder<>(true);
110110

111111
var forEachDownProcessor = new Holder<BiConsumer<LogicalPlan, Holder<Boolean>>>();
112-
processingLambda.set((LogicalPlan p, Holder<Boolean> breakEarly) -> {// go over each plan top-down
112+
forEachDownProcessor.set((LogicalPlan p, Holder<Boolean> breakEarly) -> {// go over each plan top-down
113113
if (p instanceof Fork fork) {
114114
// Early return from forEachDown. We will iterate over the children manually and end the recursion via forEachDown early.
115115
var forkRefsResult = AttributeSet.builder();
@@ -218,7 +218,7 @@ public static PreAnalysisResult resolveFieldNames(LogicalPlan parsed, EnrichReso
218218
});
219219
}
220220
});
221-
parsed.forEachDownMayReturnEarly(processingLambda.get());
221+
parsed.forEachDownMayReturnEarly(forEachDownProcessor.get());
222222

223223
if (projectAll.get()) {
224224
return new PreAnalysisResult(enrichResolution, IndexResolver.ALL_FIELDS, Set.of());

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/session/FieldNameUtilsTests.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ public void testDirectFilter() {
7373
);
7474
}
7575

76+
public void testForkEval() {
77+
assertFieldNames(
78+
"FROM employees | fork (eval x = 1 | keep x) (eval y = 2 | keep y) (eval z = 3 | keep z)",
79+
Set.of("*")
80+
);
81+
}
82+
7683
public void testSort1() {
7784
assertFieldNames(
7885
"from employees | sort still_hired, emp_no | keep emp_no, still_hired | limit 3",

0 commit comments

Comments
 (0)