|
64 | 64 | import org.elasticsearch.xpack.esql.plan.IndexPattern; |
65 | 65 | import org.elasticsearch.xpack.esql.plan.logical.Explain; |
66 | 66 | import org.elasticsearch.xpack.esql.plan.logical.LogicalPlan; |
67 | | -import org.elasticsearch.xpack.esql.plan.logical.inference.InferencePlan; |
68 | 67 | import org.elasticsearch.xpack.esql.plan.logical.join.InlineJoin; |
69 | 68 | import org.elasticsearch.xpack.esql.plan.logical.local.LocalRelation; |
70 | 69 | import org.elasticsearch.xpack.esql.plan.logical.local.LocalSupplier; |
@@ -388,8 +387,13 @@ public void analyzedPlan( |
388 | 387 | var listener = SubscribableListener.<EnrichResolution>newForked( |
389 | 388 | l -> enrichPolicyResolver.resolvePolicies(unresolvedPolicies, executionInfo, l) |
390 | 389 | ) |
391 | | - .<PreAnalysisResult>andThen((l, enrichResolution) -> resolveFieldNames(parsed, enrichResolution, l)) |
392 | | - .<PreAnalysisResult>andThen((l, preAnalysisResult) -> resolveInferences(preAnalysis.inferencePlans, preAnalysisResult, l)); |
| 390 | + .<PreAnalysisResult>andThenApply(enrichResolution -> FieldNameUtils.resolveFieldNames(parsed, enrichResolution)) |
| 391 | + .<PreAnalysisResult>andThen( |
| 392 | + (l, preAnalysisResult) -> inferenceRunner.resolveInferenceIds( |
| 393 | + preAnalysis.inferencePlans, |
| 394 | + l.map(preAnalysisResult::withInferenceResolution) |
| 395 | + ) |
| 396 | + ); |
393 | 397 | // first resolve the lookup indices, then the main indices |
394 | 398 | for (var index : preAnalysis.lookupIndices) { |
395 | 399 | listener = listener.andThen((l, preAnalysisResult) -> preAnalyzeLookupIndex(index, preAnalysisResult, executionInfo, l)); |
@@ -742,18 +746,6 @@ private static void analyzeAndMaybeRetry( |
742 | 746 | logicalPlanListener.onResponse(plan); |
743 | 747 | } |
744 | 748 |
|
745 | | - private static void resolveFieldNames(LogicalPlan parsed, EnrichResolution enrichResolution, ActionListener<PreAnalysisResult> l) { |
746 | | - ActionListener.completeWith(l, () -> FieldNameUtils.resolveFieldNames(parsed, enrichResolution)); |
747 | | - } |
748 | | - |
749 | | - private void resolveInferences( |
750 | | - List<InferencePlan<?>> inferencePlans, |
751 | | - PreAnalysisResult preAnalysisResult, |
752 | | - ActionListener<PreAnalysisResult> l |
753 | | - ) { |
754 | | - inferenceRunner.resolveInferenceIds(inferencePlans, l.map(preAnalysisResult::withInferenceResolution)); |
755 | | - } |
756 | | - |
757 | 749 | private PhysicalPlan logicalPlanToPhysicalPlan(LogicalPlan optimizedPlan, EsqlQueryRequest request) { |
758 | 750 | PhysicalPlan physicalPlan = optimizedPhysicalPlan(optimizedPlan); |
759 | 751 | physicalPlan = physicalPlan.transformUp(FragmentExec.class, f -> { |
|
0 commit comments