Skip to content

Commit 20db58a

Browse files
committed
swap resolution order order
1 parent bd1116a commit 20db58a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
import java.util.Set;
4343
import java.util.stream.Collectors;
4444

45+
import static java.util.stream.Collectors.toSet;
46+
4547
public class EsqlCCSUtils {
4648

4749
private EsqlCCSUtils() {}
@@ -206,7 +208,7 @@ static void updateExecutionInfoWithClustersWithNoMatchingIndices(
206208
// NOTE: we assume that updateExecutionInfoWithUnavailableClusters() was already run and took care of unavailable clusters.
207209
final Set<String> clustersWithNoMatchingIndices = executionInfo.getClusterStates(Cluster.Status.RUNNING)
208210
.map(Cluster::getClusterAlias)
209-
.collect(Collectors.toSet());
211+
.collect(toSet());
210212
for (String indexName : indexResolution.resolvedIndices()) {
211213
clustersWithNoMatchingIndices.remove(RemoteClusterAware.parseClusterAlias(indexName));
212214
}
@@ -414,4 +416,10 @@ public static String inClusterName(String clusterAlias) {
414416
return "in remote cluster [" + clusterAlias + "]";
415417
}
416418
}
419+
420+
public static Set<String> getRemotesOf(Set<String> concreteIndices) {
421+
return concreteIndices.stream().map(RemoteClusterAware::parseClusterAlias).collect(toSet());
422+
}
423+
424+
417425
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,8 @@ public void analyzedPlan(
380380
<EnrichResolution>newForked(l -> enrichPolicyResolver.resolvePolicies(preAnalysis.enriches, executionInfo, l))
381381
.<PreAnalysisResult>andThenApply(enrichResolution -> FieldNameUtils.resolveFieldNames(parsed, enrichResolution))
382382
.<PreAnalysisResult>andThen((l, r) -> resolveInferences(parsed, r, l))
383-
.<PreAnalysisResult>andThen((l, r) -> preAnalyzeLookupIndices(preAnalysis.lookupIndices.iterator(), r, executionInfo, l))
384383
.<PreAnalysisResult>andThen((l, r) -> preAnalyzeMainIndices(preAnalysis, executionInfo, r, requestFilter, l))
384+
.<PreAnalysisResult>andThen((l, r) -> preAnalyzeLookupIndices(preAnalysis.lookupIndices.iterator(), r, executionInfo, l))
385385
.<LogicalPlan>andThen((l, r) -> analyzeWithRetry(parsed, requestFilter, preAnalysis, executionInfo, r, l))
386386
.addListener(logicalPlanListener);
387387
}

0 commit comments

Comments
 (0)