Skip to content

Backport 143399#144235

Merged
luigidellaquila merged 5 commits intoelastic:9.3from
luigidellaquila:backport_143399
Mar 14, 2026
Merged

Backport 143399#144235
luigidellaquila merged 5 commits intoelastic:9.3from
luigidellaquila:backport_143399

Conversation

@luigidellaquila
Copy link
Copy Markdown
Member

(late) Manual backport of #143399

Copy link
Copy Markdown
Contributor

@alex-spies alex-spies left a comment

Choose a reason for hiding this comment

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

Backport looks alright to me except for a few lost updates and some of #144210 spilling into it. Mostly, the PromQL-related stuff should be removed before merging.

Comment on lines +77 to +80
// In PromQL, queries never fail due to a field not being mapped, instead an empty result is returned.
if (plan instanceof PromqlCommand) {
return resolve(plan, false);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PromQL-related changes don't need backporting. #141532 only made it into 9.4. This should be removed again.

Comment on lines 84 to 95
var unresolved = collectUnresolved(plan);
if (unresolved.isEmpty()) {
LinkedHashMap<String, List<UnresolvedAttribute>> unresolvedByName = collectUnresolved(plan);
if (unresolvedByName.isEmpty()) {
return plan;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is including changes that are being backported in #144210. Let's merge the other one first.

Comment on lines +359 to +362
if (plan instanceof PromqlCommand promqlCommand) {
// The expressions of the PromqlCommand itself are not relevant here.
// The promqlPlan is a separate tree and its children may contain UnresolvedAttribute expressions
promqlCommand.promqlPlan().forEachExpressionDown(UnresolvedAttribute.class, collectUnresolved);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

More PromQL changes that shouldn't be backported.

FWIW, the backport #144210 keeps on ignoring PromQL here, so it could make things a little easier once it's in 9.3

@@ -29,7 +30,7 @@ public interface PlanStreamOutput {
* @param field The EsField to serialize
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: missing the description of the transportVersion param which is added in #143399.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Eval still in the comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Eval still in the comment

var leftDne2 = as(leftEvalEval.fields().get(3), Alias.class);
assertThat(leftDne2.name(), is("does_not_exist2"));
assertThat(as(leftDne2.child(), Literal.class).dataType(), is(DataType.NULL));
assertThat(leftDne2.id(), is(leftProject_does_not_exist2.id()));

var leftRel = as(leftEvalEval.child(), EsRelation.class);
assertThat(leftRel.indexPattern(), is("test"));

// Right branch: Project + Eval many nulls, Subquery -> Filter -> Eval -> EsRelation[languages]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Update got lost, EVAL still mentioned

@luigidellaquila luigidellaquila merged commit 6d2ca4b into elastic:9.3 Mar 14, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants