Skip to content

[9.3] ESQL: Skip nullifying aliases for Aggregate groups (#141340)#144097

Merged
elasticsearchmachine merged 10 commits intoelastic:9.3from
alex-spies:backport/9.3/pr-141340
Mar 13, 2026
Merged

[9.3] ESQL: Skip nullifying aliases for Aggregate groups (#141340)#144097
elasticsearchmachine merged 10 commits intoelastic:9.3from
alex-spies:backport/9.3/pr-141340

Conversation

@alex-spies
Copy link
Copy Markdown
Contributor

@alex-spies alex-spies commented Mar 12, 2026

Backport

This will backport the following commits from main to 9.3:

* Fix injected attributes's IDs on UnionAll branches
* Skip nullifying of aliases for Aggregate groups
* Fix LookupJoin getting Evals inserted on the right-hand side
* Log skipped spec tests if capabilities were missing
* Add minimal TS spec tests for nullify
* Add reproducer test for join issue
* Add spec test: STATS BY missing with FROM

---------

Co-authored-by: Alexander Spies <alexander.spies@elastic.co>
Co-authored-by: Ievgen Degtiarenko <ievgen.degtiarenko@elastic.co>
Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
(cherry picked from commit f7b87e3)

# Conflicts:
#	muted-tests.yml
#	x-pack/plugin/esql/qa/testFixtures/src/main/resources/unmapped-nullify.csv-spec
#	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java
#	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/analysis/Analyzer.java
#	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/analysis/rules/ResolveUnmapped.java
#	x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/AnalyzerUnmappedTests.java
Comment on lines +237 to +253
@SuppressWarnings("unchecked")
public T transformDownSkipBranch(BiFunction<? super T, Holder<Boolean>, ? extends T> rule) {
Holder<Boolean> skipBranch = new Holder<>(Boolean.FALSE);
return transformDownSkipBranch(skipBranch, rule);
}

@SuppressWarnings("unchecked")
T transformDownSkipBranch(Holder<Boolean> skipBranch, BiFunction<? super T, Holder<Boolean>, ? extends T> rule) {
T root = rule.apply((T) this, skipBranch);
Node<T> node = this.equals(root) ? this : root;
if (skipBranch.get()) {
skipBranch.set(false);
return (T) node;
}
return node.transformChildren(child -> child.transformDownSkipBranch(skipBranch, rule));
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already exists on main, introduced in #140090

@alex-spies alex-spies enabled auto-merge (squash) March 12, 2026 12:14
@alex-spies alex-spies added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Mar 12, 2026
@elasticsearchmachine elasticsearchmachine merged commit 9fde5ff into elastic:9.3 Mar 13, 2026
36 checks passed
@alex-spies alex-spies deleted the backport/9.3/pr-141340 branch March 13, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport >bug v9.3.3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants