Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -225,8 +225,7 @@ private static String keep(List<Column> previousOutput) {

private static String randomName(List<Column> previousOutput) {
String result = randomRawName(previousOutput);
if (result.isEmpty() // bug https://github.com/elastic/elasticsearch/issues/125870, we'll manage it as an error later
|| (randomBoolean() && result.contains("*") == false)) {
if ((randomBoolean() && result.contains("*") == false)) {
result = "`" + result + "`";
}
return result;
Expand Down Expand Up @@ -311,12 +310,10 @@ private static String rename(List<Column> previousOutput) {
continue;
}
nameToType.put(newName, nameToType.get(name));
if (name.length() == 0 // https://github.com/elastic/elasticsearch/issues/125870, we'll manage it as an error later
|| (randomBoolean() && name.startsWith("`") == false)) {
if (randomBoolean() && name.startsWith("`") == false) {
name = "`" + name + "`";
}
if (newName.length() == 0 // https://github.com/elastic/elasticsearch/issues/125870, we'll manage it as an error later
|| (randomBoolean() && newName.startsWith("`") == false)) {
if (randomBoolean() && newName.startsWith("`") == false) {
newName = "`" + newName + "`";
}
proj.add(name + " AS " + newName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ public abstract class GenerativeRestTest extends ESRestTestCase {
// Awaiting fixes
"Unknown column \\[<all-fields-projected>\\]", // https://github.com/elastic/elasticsearch/issues/121741,
"Plan \\[ProjectExec\\[\\[<no-fields>.* optimized incorrectly due to missing references", // https://github.com/elastic/elasticsearch/issues/125866
"token recognition error at: ", // https://github.com/elastic/elasticsearch/issues/125870
// https://github.com/elastic/elasticsearch/issues/127167
"optimized incorrectly due to missing references", // https://github.com/elastic/elasticsearch/issues/116781
"No matches found for pattern", // https://github.com/elastic/elasticsearch/issues/126418
"Unknown column", // https://github.com/elastic/elasticsearch/issues/127467
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,18 @@ max:integer
13
;

evalAfterStatsUsingSameName3
required_capability: remove_empty_attribute_in_merging_output
from employees
| stats foo = min(emp_no), bar = count_distinct(emp_no)
| rename bar AS bug_here, foo AS baz, baz AS bug_here
| eval bug_here = "something"
;

bug_here:keyword
something
;

evalAfterAvgGroupingUsingSameName
required_capability: retain_aggregate_when_grouping
from employees
Expand Down Expand Up @@ -752,3 +764,27 @@ g:integer | max:integer
12 | 2
12 | 2
;

evalAfterGroupingUsingSameName5
required_capability: retain_aggregate_when_grouping
required_capability: enrich_load
required_capability: join_lookup_v12
from firewall_logs,threat_list,airports
| keep `message`, `name`, source.IP, `type`, message
| enrich languages_policy on message
| drop type
| dissect name "%{message}"
| rename language_name as message
| lookup join message_types_lookup on message
| rename `source.IP` AS EkooZqOYHpD, `EkooZqOYHpD` AS `XzWnUOjttGQD`
| drop `XzWnUOjttGQD` | stats type = count_distinct(name), `name` = count(*), JhbpKFAaRq = count(*)
| limit 5791
| keep name
| eval `name` = true, nhIWDevxEtU = null, name = true, `name` = 1, sPMxyWXGSHm = "a", TewXimOwcBYr = true
| stats `nhIWDevxEtU` = min(name) by name
| eval dsjbDWegyVkg = false, name = null, name = 1, nhIWDevxEtU = null, iPIbTFddDK = 1, rUvqtgSl = 1
;

dsjbDWegyVkg:boolean | name:integer | nhIWDevxEtU:null | iPIbTFddDK:integer | rUvqtgSl:integer
false | 1 | null | 1 | 1
;