Similar to the bug reported in https://github.com/elastic/elasticsearch/issues/100186, it seems that stats over multiple indices where some might be missing the column generate errors:

    FROM logs-* | STATS count=count(*) BY agent.version

Results in:

    ValuesSources are mismatched

This happens in benchmarking tests where very little data is generated. The full benchmarks have all data generated, and the error does not occur, so we presume the issue might be either:

* A mismatch between documents created and index mappings
* Or missing data in indexes that do have this field mapped

The error trace is:

```
java.lang.IllegalStateException: ValuesSources are mismatched
	at org.elasticsearch.compute.operator.OrdinalsGroupingOperator.<init>(OrdinalsGroupingOperator.java:102)
	at org.elasticsearch.compute.operator.OrdinalsGroupingOperator.get(OrdinalsGroupingOperator.java:64)
	at org.elasticsearch.xpack.esql.planner.LocalExecutionPlanner.lambda-zsh(LocalExecutionPlanner.java:646)
	at java.base/java.util.stream.ReferencePipeline.accept(ReferencePipeline.java:197)
	at java.base/java.util.ArrayList.forEachRemaining(ArrayList.java:1625)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ForEachOps.evaluateSequential(ForEachOps.java:150)
	at java.base/java.util.stream.ForEachOps.evaluateSequential(ForEachOps.java:173)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
	at org.elasticsearch.xpack.esql.planner.LocalExecutionPlanner.operators(LocalExecutionPlanner.java:646)
	at org.elasticsearch.xpack.esql.planner.LocalExecutionPlanner.apply(LocalExecutionPlanner.java:730)
	at org.elasticsearch.xpack.esql.planner.LocalExecutionPlanner.createDrivers(LocalExecutionPlanner.java:773)
	at org.elasticsearch.xpack.esql.plugin.ComputeService.runCompute(ComputeService.java:265)
	at org.elasticsearch.xpack.esql.plugin.ComputeService.lambda(ComputeService.java:432)
	at org.elasticsearch.server@8.12.0-SNAPSHOT/org.elasticsearch.action.ActionListener.onResponse(ActionListener.java:177)
	at org.elasticsearch.server@8.12.0-SNAPSHOT/org.elasticsearch.action.ActionListener.completeWith(ActionListener.java:305)
	at org.elasticsearch.xpack.esql.plugin.ComputeService.lambda(ComputeService.java:301)
	at org.elasticsearch.server@8.12.0-SNAPSHOT/org.elasticsearch.index.shard.IndexShard.ensureShardSearchActive(IndexShard.java:3932)
	at org.elasticsearch.xpack.esql.plugin.ComputeService.acquireSearchContexts(ComputeService.java:299)
	at org.elasticsearch.xpack.esql.plugin.ComputeService.messageReceived(ComputeService.java:430)
	at org.elasticsearch.xpack.esql.plugin.ComputeService.messageReceived(ComputeService.java:422)
	at org.elasticsearch.server@8.12.0-SNAPSHOT/org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:75)
	at org.elasticsearch.server@8.12.0-SNAPSHOT/org.elasticsearch.transport.TransportService.doRun(TransportService.java:1020)
	at org.elasticsearch.server@8.12.0-SNAPSHOT/org.elasticsearch.common.util.concurrent.ThreadContext.doRun(ThreadContext.java:983)
	at org.elasticsearch.server@8.12.0-SNAPSHOT/org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
	at org.elasticsearch.server@8.12.0-SNAPSHOT/org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:33)
	at org.elasticsearch.server@8.12.0-SNAPSHOT/org.elasticsearch.common.util.concurrent.ThreadContext.doRun(ThreadContext.java:983)
	at org.elasticsearch.server@8.12.0-SNAPSHOT/org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1623)
```

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/OrdinalsGroupingOperator.java
return new Page(blocks);
            } finally {
                if (success == false) {
                    Releasables.closeExpectNoException(blocks);
                }
            }
        } finally {
            Releasables.close(() -> Releasables.close(aggregators));
        }
    }
    @Override
    public boolean isFinished() {
        return finished && valuesAggregator == null && ordinalAggregators.isEmpty();
    }
    @Override
    public void close() {
        Releasables.close(() -> Releasables.close(ordinalAggregators.values()), valuesAggregator);
    }
    private static void checkState(boolean condition, String msg) {
        if (condition == false) {
            throw new IllegalArgumentException(msg);
        }
    }
    @Override
    public String toString() {
        return this.getClass().getSimpleName() + "[" + "aggregators=" + aggregatorFactories + "]";
    }
    record SegmentID(int shardIndex, int segmentIndex) {
    }
    static final class OrdinalSegmentAggregator implements Releasable, SeenGroupIds {