Skip to content

Commit 7269b75

Browse files
authored
ESQL: Remove temporary workarounds for resolved bugs (elastic#127499)
1 parent 80946ce commit 7269b75

File tree

3 files changed

+39
-8
lines changed

3 files changed

+39
-8
lines changed

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,7 @@ private static String keep(List<Column> previousOutput) {
225225

226226
private static String randomName(List<Column> previousOutput) {
227227
String result = randomRawName(previousOutput);
228-
if (result.isEmpty() // bug https://github.com/elastic/elasticsearch/issues/125870, we'll manage it as an error later
229-
|| (randomBoolean() && result.contains("*") == false)) {
228+
if ((randomBoolean() && result.contains("*") == false)) {
230229
result = "`" + result + "`";
231230
}
232231
return result;
@@ -311,12 +310,10 @@ private static String rename(List<Column> previousOutput) {
311310
continue;
312311
}
313312
nameToType.put(newName, nameToType.get(name));
314-
if (name.length() == 0 // https://github.com/elastic/elasticsearch/issues/125870, we'll manage it as an error later
315-
|| (randomBoolean() && name.startsWith("`") == false)) {
313+
if (randomBoolean() && name.startsWith("`") == false) {
316314
name = "`" + name + "`";
317315
}
318-
if (newName.length() == 0 // https://github.com/elastic/elasticsearch/issues/125870, we'll manage it as an error later
319-
|| (randomBoolean() && newName.startsWith("`") == false)) {
316+
if (randomBoolean() && newName.startsWith("`") == false) {
320317
newName = "`" + newName + "`";
321318
}
322319
proj.add(name + " AS " + newName);

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ public abstract class GenerativeRestTest extends ESRestTestCase {
5050
// Awaiting fixes
5151
"Unknown column \\[<all-fields-projected>\\]", // https://github.com/elastic/elasticsearch/issues/121741,
5252
"Plan \\[ProjectExec\\[\\[<no-fields>.* optimized incorrectly due to missing references", // https://github.com/elastic/elasticsearch/issues/125866
53-
"token recognition error at: ", // https://github.com/elastic/elasticsearch/issues/125870
54-
// https://github.com/elastic/elasticsearch/issues/127167
5553
"optimized incorrectly due to missing references", // https://github.com/elastic/elasticsearch/issues/116781
5654
"No matches found for pattern", // https://github.com/elastic/elasticsearch/issues/126418
5755
"Unknown column", // https://github.com/elastic/elasticsearch/issues/127467

x-pack/plugin/esql/qa/testFixtures/src/main/resources/eval.csv-spec

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,18 @@ max:integer
674674
13
675675
;
676676

677+
evalAfterStatsUsingSameName3
678+
required_capability: remove_empty_attribute_in_merging_output
679+
from employees
680+
| stats foo = min(emp_no), bar = count_distinct(emp_no)
681+
| rename bar AS bug_here, foo AS baz, baz AS bug_here
682+
| eval bug_here = "something"
683+
;
684+
685+
bug_here:keyword
686+
something
687+
;
688+
677689
evalAfterAvgGroupingUsingSameName
678690
required_capability: retain_aggregate_when_grouping
679691
from employees
@@ -752,3 +764,27 @@ g:integer | max:integer
752764
12 | 2
753765
12 | 2
754766
;
767+
768+
evalAfterGroupingUsingSameName5
769+
required_capability: retain_aggregate_when_grouping
770+
required_capability: enrich_load
771+
required_capability: join_lookup_v12
772+
from firewall_logs,threat_list,airports
773+
| keep `message`, `name`, source.IP, `type`, message
774+
| enrich languages_policy on message
775+
| drop type
776+
| dissect name "%{message}"
777+
| rename language_name as message
778+
| lookup join message_types_lookup on message
779+
| rename `source.IP` AS EkooZqOYHpD, `EkooZqOYHpD` AS `XzWnUOjttGQD`
780+
| drop `XzWnUOjttGQD` | stats type = count_distinct(name), `name` = count(*), JhbpKFAaRq = count(*)
781+
| limit 5791
782+
| keep name
783+
| eval `name` = true, nhIWDevxEtU = null, name = true, `name` = 1, sPMxyWXGSHm = "a", TewXimOwcBYr = true
784+
| stats `nhIWDevxEtU` = min(name) by name
785+
| eval dsjbDWegyVkg = false, name = null, name = 1, nhIWDevxEtU = null, iPIbTFddDK = 1, rUvqtgSl = 1
786+
;
787+
788+
dsjbDWegyVkg:boolean | name:integer | nhIWDevxEtU:null | iPIbTFddDK:integer | rUvqtgSl:integer
789+
false | 1 | null | 1 | 1
790+
;

0 commit comments

Comments
 (0)