Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,6 @@ public IncludeExecutionMetadata includeExecutionMetadata() {
return includeExecutionMetadata;
}

public Predicate<String> skipOnFailurePredicate() {
return skipOnFailurePredicate;
}

/**
* Call when ES|QL "planning" phase is complete and query execution (in ComputeService) is about to start.
* Note this is currently only built for a single phase planning/execution model. When INLINE STATS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ public void messageReceived(LookupRequest request, TransportChannel channel, Tas
}
try (ThreadContext.StoredContext ignored = threadContext.stashWithOrigin(ClientHelper.ENRICH_ORIGIN)) {
String indexName = EnrichPolicy.getBaseName(policyName);
indexResolver.resolveAsMergedMapping(
indexResolver.resolveIndices(
indexName,
IndexResolver.ALL_FIELDS,
null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ private void preAnalyzeLookupIndex(
ThreadPool.Names.SEARCH_COORDINATION,
ThreadPool.Names.SYSTEM_READ
);
indexResolver.resolveAsMergedMapping(
indexResolver.resolveIndices(
EsqlCCSUtils.createQualifiedLookupIndexExpressionFromAvailableClusters(executionInfo, localPattern),
result.wildcardJoinIndices().contains(localPattern) ? IndexResolver.ALL_FIELDS : result.fieldNames,
null,
Expand Down Expand Up @@ -837,7 +837,7 @@ private void preAnalyzeMainIndices(
// return empty resolution if the expression is pure CCS and resolved no remote clusters (like no-such-cluster*:index)
listener.onResponse(result.withIndices(indexPattern, IndexResolution.empty(indexPattern.indexPattern())));
} else {
indexResolver.resolveAsMergedMappingAndRetrieveMinimumVersion(
indexResolver.resolveIndicesVersioned(
indexPattern.indexPattern(),
result.fieldNames,
// Maybe if no indices are returned, retry without index mode and provide a clearer error message.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public IndexResolver(Client client) {
/**
* Resolves a pattern to one (potentially compound meaning that spawns multiple indices) mapping.
*/
public void resolveAsMergedMapping(
public void resolveIndices(
String indexWildcard,
Set<String> fieldNames,
QueryBuilder requestFilter,
Expand All @@ -95,26 +95,22 @@ public void resolveAsMergedMapping(
boolean useDenseVectorWhenNotSupported,
ActionListener<IndexResolution> listener
) {
ActionListener<Versioned<IndexResolution>> ignoreVersion = listener.delegateFailureAndWrap(
(l, versionedResolution) -> l.onResponse(versionedResolution.inner())
);

resolveAsMergedMappingAndRetrieveMinimumVersion(
resolveIndicesVersioned(
indexWildcard,
fieldNames,
requestFilter,
includeAllDimensions,
useAggregateMetricDoubleWhenNotSupported,
useDenseVectorWhenNotSupported,
ignoreVersion
listener.map(Versioned::inner)
);
}

/**
* Resolves a pattern to one (potentially compound meaning that spawns multiple indices) mapping. Also retrieves the minimum transport
* version available in the cluster (and remotes).
*/
public void resolveAsMergedMappingAndRetrieveMinimumVersion(
public void resolveIndicesVersioned(
String indexWildcard,
Set<String> fieldNames,
QueryBuilder requestFilter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.compute.data.Block;
import org.elasticsearch.compute.data.BlockFactory;
import org.elasticsearch.compute.data.BlockUtils;
import org.elasticsearch.compute.data.Page;
import org.elasticsearch.core.Releasables;
import org.elasticsearch.xpack.esql.core.expression.Attribute;
import org.elasticsearch.xpack.esql.planner.PlannerUtils;

import java.util.ArrayList;
import java.util.List;
import java.util.function.LongFunction;

Expand Down Expand Up @@ -51,15 +49,4 @@ public static long checkPagesBelowSize(List<Page> pages, ByteSizeValue maxSize,
}
return currentSize;
}

public static List<Object> fromPage(List<Attribute> schema, Page page) {
if (page.getPositionCount() != 1) {
throw new IllegalArgumentException("expected single row");
}
List<Object> values = new ArrayList<>(schema.size());
for (int i = 0; i < schema.size(); i++) {
values.add(BlockUtils.toJavaObject(page.getBlock(i), 0));
}
return values;
}
}