Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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 @@ -38,6 +38,7 @@
import org.elasticsearch.index.IndexSettings;
import org.elasticsearch.index.mapper.DateFieldMapper;
import org.elasticsearch.index.mapper.extras.MapperExtrasPlugin;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.index.query.RangeQueryBuilder;
import org.elasticsearch.index.shard.IndexShard;
Expand Down Expand Up @@ -147,6 +148,13 @@ public void testRow() {
}
}

public void testRowWithFilter() {
long value = randomLongBetween(0, Long.MAX_VALUE);
try (EsqlQueryResponse response = run(syncEsqlQueryRequest().query("row " + value).filter(new BoolQueryBuilder().boost(1.0f)))) {
assertEquals(List.of(List.of(value)), getValuesList(response));
}
}

public void testFromStatsGroupingAvgWithSort() {
testFromStatsGroupingAvgImpl("from test | stats avg(count) by data | sort data | limit 2", "data", "avg(count)");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,9 @@ private void analyzeWithRetry(
if (result.indices.isValid() || requestFilter != null) {
// We won't run this check with no filter and no valid indices since this may lead to false positive - missing index report
// when the resolution result is not valid for a different reason.
EsqlCCSUtils.updateExecutionInfoWithClustersWithNoMatchingIndices(executionInfo, result.indices, requestFilter != null);
if (executionInfo.clusterInfo.isEmpty() == false) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could also be if(executionInfo.isCrossClusterSearch()) because there's really no point of doing this if it's not cross-cluster - the only way it could do anything is if the local indices are all filtered and this case is already handled by the verifier. Which would implicitly include your case also.

EsqlCCSUtils.updateExecutionInfoWithClustersWithNoMatchingIndices(executionInfo, result.indices, requestFilter != null);
}
}
LogicalPlan plan = analyzedPlan(parsed, result, executionInfo);
LOGGER.debug("Analyzed plan ({}):\n{}", description, plan);
Expand Down