Skip to content

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

luigidellaquila
Copy link
Contributor

@luigidellaquila luigidellaquila commented May 27, 2025

Adding support for LOOKUP JOIN on aliases:

  • remove validation checks for aliases
  • use the alias name for security checks
  • take into consideration filter aliases

@elasticsearchmachine
Copy link
Collaborator

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);
Copy link
Contributor Author

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.

@luigidellaquila luigidellaquila marked this pull request as ready for review May 29, 2025 09:31
@luigidellaquila luigidellaquila requested a review from nik9000 May 29, 2025 09:31
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label May 29, 2025
@astefan astefan self-requested a review May 29, 2025 09:34
@@ -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 };
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/ES|QL AKA ESQL >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants