Skip to content

Commit 446cffd

Browse files
committed
fix test
1 parent 27c236b commit 446cffd

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/optimizer/rules/logical/TranslateTimeSeriesAggregate.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import org.elasticsearch.xpack.esql.core.expression.Literal;
1717
import org.elasticsearch.xpack.esql.core.expression.MetadataAttribute;
1818
import org.elasticsearch.xpack.esql.core.expression.NamedExpression;
19+
import org.elasticsearch.xpack.esql.core.tree.Node;
1920
import org.elasticsearch.xpack.esql.core.type.DataType;
2021
import org.elasticsearch.xpack.esql.core.util.CollectionUtils;
2122
import org.elasticsearch.xpack.esql.core.util.Holder;
@@ -245,7 +246,8 @@ protected LogicalPlan rule(TimeSeriesAggregate aggregate, LogicalOptimizerContex
245246
var timestampAwareFunctions = timeSeriesAggs.keySet()
246247
.stream()
247248
.filter(ts -> ts instanceof TimestampAware)
248-
.map(ts -> ts.sourceText())
249+
.map(Node::sourceText)
250+
.sorted()
249251
.toList();
250252
if (timestampAwareFunctions.isEmpty() == false) {
251253
int size = timestampAwareFunctions.size();

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/LogicalPlanOptimizerTests.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9675,7 +9675,6 @@ public void testFullTextFunctionOnEvalNull() {
96759675
assertEquals("test", relation.indexPattern());
96769676
}
96779677

9678-
96799678
/*
96809679
* Renaming or shadowing the @timestamp field prior to running stats with TS command is not allowed.
96819680
*/
@@ -9690,7 +9689,7 @@ STATS max(network.cost), count(network.eth0.rx)
96909689
""")))
96919690
).getMessage(),
96929691
containsString("""
9693-
Functions [max(network.cost), count(network.eth0.rx)] requires a @timestamp field of type date \
9692+
Functions [count(network.eth0.rx), max(network.cost)] requires a @timestamp field of type date \
96949693
to be present when run with the TS command, but it was not present.""")
96959694
);
96969695

0 commit comments

Comments
 (0)