- 
                Notifications
    
You must be signed in to change notification settings  - Fork 25.6k
 
ESQL: Make it a little easier to test LOOKUP #120540
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
Conversation
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.
| 
           Pinging @elastic/es-analytical-engine (Team:Analytics)  | 
    
| EsPhysicalOperationProviders.ShardContext context, | ||
| SearchExecutionContext executionContext, | ||
| Releasable release | ||
| ) { | 
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.
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.
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.
👍
| 
           Thanks @costin !  | 
    
* 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
| 
           Backport #120555  | 
    
* 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 { | 
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.
NIT: Should this be called LookupShardContextFactory to avoid confusion with a method name?
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.
Yeah, that probably would have been more clear. I can rename this in the followup PR you just reviewed.
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.
Thank you!
This changes the internals of LOOKUP so they don't rely directly on
SearchContext, instead relying on their ownLookupShardContextwhich is easy to build from aSearchContext. The advantage is that it's easier to build it without aSearchContextwhich makes unit testing a ton easier.