Skip to content

Commit 044e127

Browse files
committed
more bug
1 parent d0e24d1 commit 044e127

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/generative/GenerativeRestTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ public abstract class GenerativeRestTest extends ESRestTestCase {
6767
// TS-command tests
6868
"Invalid call to dataType on an unresolved object \\?LASTOVERTIME", // https://github.com/elastic/elasticsearch/issues/134791
6969
"class org.elasticsearch.compute.data..*Block cannot be cast to class org.elasticsearch.compute.data..*Block", // https://github.com/elastic/elasticsearch/issues/134793
70-
"Output has changed from \\[.*\\] to \\[.*\\]" // https://github.com/elastic/elasticsearch/issues/134794
70+
"Output has changed from \\[.*\\] to \\[.*\\]", // https://github.com/elastic/elasticsearch/issues/134794
71+
"unsupported logical plan node \\[Join\\]", // https://github.com/elastic/elasticsearch/issues/134882
72+
"To perform a lookup join with index \\[.*\\], it must be a in lookup index mode" // https://github.com/elastic/elasticsearch/issues/134882
7173
);
7274

7375
public static final Set<Pattern> ALLOWED_ERROR_PATTERNS = ALLOWED_ERRORS.stream()

x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/generative/command/pipe/TimeSeriesStatsGenerator.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ public CommandDescription generate(
4848
return EMPTY_DESCRIPTION;
4949
}
5050

51+
// TODO: Switch back to using nonNull as possible arguments for aggregations. Using the timestamp field in both the bucket as well
52+
// as as an argument in an aggregation causes all sorts of bizarre errors with confusing messages.
53+
List<EsqlQueryGenerator.Column> acceptableFields = nonNull.stream()
54+
.filter(c -> c.type().equals("datetime") == false && c.type().equals("date_nanos") == false)
55+
.filter(c -> c.name().equals("@timestamp") == false)
56+
.toList();
57+
5158
StringBuilder cmd = new StringBuilder(" | stats ");
5259

5360
// TODO: increase range max to 5
@@ -57,13 +64,15 @@ public CommandDescription generate(
5764
if (randomBoolean()) {
5865
name = EsqlQueryGenerator.randomIdentifier();
5966
} else {
60-
name = EsqlQueryGenerator.randomName(previousOutput);
67+
name = EsqlQueryGenerator.randomName(acceptableFields);
6168
if (name == null) {
6269
name = EsqlQueryGenerator.randomIdentifier();
6370
}
6471
}
6572
// generate the aggregation
66-
String expression = randomBoolean() ? EsqlQueryGenerator.metricsAgg(nonNull) : EsqlQueryGenerator.agg(nonNull);
73+
String expression = randomBoolean()
74+
? EsqlQueryGenerator.metricsAgg(acceptableFields)
75+
: EsqlQueryGenerator.agg(acceptableFields);
6776
if (i > 0) {
6877
cmd.append(",");
6978
}
@@ -75,7 +84,7 @@ public CommandDescription generate(
7584

7685
cmd.append(" by ");
7786
if (randomBoolean()) {
78-
var col = EsqlQueryGenerator.randomGroupableName(nonNull);
87+
var col = EsqlQueryGenerator.randomGroupableName(acceptableFields);
7988
if (col != null) {
8089
cmd.append(col + ", ");
8190
}

0 commit comments

Comments
 (0)