Skip to content
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

ESQL: Drop unused parts of esql-core package #110174

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

nik9000
Copy link
Member

@nik9000 nik9000 commented Jun 26, 2024

This drops a bunch of unused code in the esql-core package that was used to power SQL and EQL. We copied it when we forked the shared ql code into esql-core. But we don't need it.

This drops a bunch of unused code in the esql-core package that was used
to power SQL and EQL. We copied it when we forked the shared ql code
into esql-core. But we don't need it.
@elasticsearchmachine
Copy link
Collaborator

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

@nik9000
Copy link
Member Author

nik9000 commented Jun 26, 2024

There's a bunch more unused code but it's a bit more complex to untangle so I'm skipping it for now.

Copy link
Contributor

@luigidellaquila luigidellaquila left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @nik9000!

Copy link
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.

Nice!

Comment on lines 40 to 44
entries.add(new Entry(Converter.class, DefaultConverter.NAME, DefaultConverter::read));

entries.add(new Entry(Processor.class, ConstantProcessor.NAME, ConstantProcessor::new));
entries.add(new Entry(Processor.class, HitExtractorProcessor.NAME, HitExtractorProcessor::new));
entries.add(new Entry(Processor.class, BucketExtractorProcessor.NAME, BucketExtractorProcessor::new));
entries.add(new Entry(Processor.class, ChainingProcessor.NAME, ChainingProcessor::new));

Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we use any processors from this class?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think none of them are used, yeah. But there weren't as easy to see so I didn't grab them in this PR.

Comment on lines -169 to -180
public void testConfigurationOptionalFunction() {
UnresolvedFunction ur = uf(DEFAULT, mock(Expression.class));
FunctionRegistry r = new FunctionRegistry(
def(DummyConfigurationOptionalArgumentFunction.class, (Source l, Expression e, Configuration c) -> {
assertSame(e, ur.children().get(0));
return new DummyConfigurationOptionalArgumentFunction(l, List.of(ur), c);
}, "dummy")
);
FunctionDefinition def = r.resolveFunction(r.resolveAlias("DUMMY"));
assertEquals(ur.source(), ur.buildResolved(randomConfiguration(), def).source());
}

Copy link
Contributor

Choose a reason for hiding this comment

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

While a bit paranoid, maybe let's port this to EsqlFunctionRegistryTests rather than just forgetting about it; we don't use ConfigurationFunction anymore, but we do have (and use) EsqlConfigurationFunction.

@nik9000 nik9000 merged commit 573e44a into elastic:main Jun 26, 2024
15 checks passed
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.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants