-
Notifications
You must be signed in to change notification settings - Fork 25.4k
ES|QL: Add support for LOOKUP JOIN on aliases #128519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ES|QL: Add support for LOOKUP JOIN on aliases #128519
Conversation
Hi @luigidellaquila, I've created a changelog YAML for you. |
if (out.getTransportVersion().onOrAfter(TransportVersions.JOIN_ON_ALIASES)) { | ||
out.writeString(indexPattern); | ||
} else if (indexPattern.equals(shardId.getIndexName()) == false) { | ||
throw new EsqlIllegalArgumentException("Aliases and index patterns are not allowed for LOOKUP JOIN []", indexPattern); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we throw an exception here?
The alternative is to just allow to execute the JOIN on the remote node based on the index name (rather than the alias name), that means different security constraints and no alias filters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Throwing is fine. It wasn't supported before that version.
Pinging @elastic/es-analytical-engine (Team:Analytics) |
@@ -521,7 +553,7 @@ abstract static class TransportRequest extends AbstractTransportRequest implemen | |||
|
|||
@Override | |||
public final String[] indices() { | |||
return new String[] { shardId.getIndexName() }; | |||
return new String[] { indexPattern }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the real fix to the Security aspects
if (out.getTransportVersion().onOrAfter(TransportVersions.JOIN_ON_ALIASES)) { | ||
out.writeString(indexPattern); | ||
} else if (indexPattern.equals(shardId.getIndexName()) == false) { | ||
throw new EsqlIllegalArgumentException("Aliases and index patterns are not allowed for LOOKUP JOIN []", indexPattern); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Throwing is fine. It wasn't supported before that version.
💔 Backport failed
You can use sqren/backport to manually backport by running |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @luigidellaquila , I think this accidentally disabled some bwc tests. Could you take a look please?
@@ -6,7 +6,7 @@ setup: | |||
- method: POST | |||
path: /_query | |||
parameters: [] | |||
capabilities: [join_lookup_v12, join_lookup_skip_mv_warnings] | |||
capabilities: [join_lookup_v12, enable_lookup_join_on_aliases] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@luigidellaquila , this skips the entire yaml test file if the capability is not present. Is this intended? This means no bwc tests between 9.1 and 9.0 in here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, let me split it
Adding support for LOOKUP JOIN on aliases: