Skip to content

Conversation

@nik9000
Copy link
Member

@nik9000 nik9000 commented Jan 21, 2025

This changes the internals of LOOKUP so they don't rely directly on SearchContext, instead relying on their own LookupShardContext which is easy to build from a SearchContext. The advantage is that it's easier to build it without a SearchContext which makes unit testing a ton easier.

This changes the internals of LOOKUP so they don't rely directly on
`SearchContext`, instead relying on their own `LookupShardContext` which
is easy to build from a `SearchContext`. The advantage is that it's
easier to build it *without* a `SearchContext` which makes unit testing
a ton easier.
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Jan 21, 2025
@elasticsearchmachine
Copy link
Collaborator

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

EsPhysicalOperationProviders.ShardContext context,
SearchExecutionContext executionContext,
Releasable release
) {
Copy link
Member Author

Choose a reason for hiding this comment

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

It's not 100% clear to me that it wouldn't be better to make this an interface, but I figure I can get that in when I make the test. I just wanted to get this change in to start talking about how the test would have to change things.

Copy link
Member

@costin costin left a comment

Choose a reason for hiding this comment

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

👍

@nik9000 nik9000 merged commit 6db7984 into elastic:main Jan 21, 2025
16 checks passed
@nik9000
Copy link
Member Author

nik9000 commented Jan 21, 2025

Thanks @costin !

nik9000 added a commit to nik9000/elasticsearch that referenced this pull request Jan 21, 2025
* ESQL: Make it a little easier to test LOOKUP

This changes the internals of LOOKUP so they don't rely directly on
`SearchContext`, instead relying on their own `LookupShardContext` which
is easy to build from a `SearchContext`. The advantage is that it's
easier to build it *without* a `SearchContext` which makes unit testing
a ton easier.

* JAVADOC
@nik9000
Copy link
Member Author

nik9000 commented Jan 21, 2025

Backport #120555

elasticsearchmachine pushed a commit that referenced this pull request Jan 21, 2025
* ESQL: Make it a little easier to test LOOKUP

This changes the internals of LOOKUP so they don't rely directly on
`SearchContext`, instead relying on their own `LookupShardContext` which
is easy to build from a `SearchContext`. The advantage is that it's
easier to build it *without* a `SearchContext` which makes unit testing
a ton easier.

* JAVADOC
/**
* Create a {@link LookupShardContext} for a locally allocated {@link ShardId}.
*/
public interface CreateShardContext {
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: Should this be called LookupShardContextFactory to avoid confusion with a method name?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, that probably would have been more clear. I can rename this in the followup PR you just reviewed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL >non-issue Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v8.18.0 v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants