Skip to content

ESQL - Refactor full text functions optimizer tests #128611

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

carlosdelest
Copy link
Member

Add coverage to LocalPhysicalPlanOptimizerTests for full text functions.

This PR creates a new inner class that encapsulates test case information for full text functions, namely the ESQL query and the corresponding QueryBuilder that it will create.

Each full text function extends the test case class to provide how an ESQL query looks like and what QueryBuilder it creates, so it can be used in tests to provide the query and check the results respectively.

Existing methods have been refactored to use this test case as a parameter, so every full text function is covered by existing test cases.

As a follow up step, we should refactor full text functions tests into its own class that uses parameterized tests - but as that would imply extracting some common methods, I have preferred to do this as a first step for adding multi_match and knn functions test coverage.

@carlosdelest carlosdelest added Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) auto-backport Automatically create backport pull requests when merged :Analytics/ES|QL AKA ESQL Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v8.19.0 v9.1.0 labels May 29, 2025
@carlosdelest
Copy link
Member Author

@elasticmachine run elasticsearch-ci/part-2

@carlosdelest carlosdelest marked this pull request as ready for review May 29, 2025 12:13
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine elasticsearchmachine removed the Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch label May 29, 2025
@carlosdelest carlosdelest enabled auto-merge (squash) June 2, 2025 06:58
@carlosdelest carlosdelest merged commit b688080 into elastic:main Jun 2, 2025
16 of 18 checks passed
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.19 Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 128611

carlosdelest added a commit to carlosdelest/elasticsearch that referenced this pull request Jun 2, 2025
…unctions (elastic#128611)

(cherry picked from commit b688080)

# Conflicts:
#	x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/LocalPhysicalPlanOptimizerTests.java
@carlosdelest
Copy link
Member Author

💚 All backports created successfully

Status Branch Result
8.19

Questions ?

Please refer to the Backport tool documentation

elasticsearchmachine pushed a commit that referenced this pull request Jun 2, 2025
…unctions (#128611) (#128734)

(cherry picked from commit b688080)

# Conflicts:
#	x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/LocalPhysicalPlanOptimizerTests.java
mridula-s109 pushed a commit to mridula-s109/elasticsearch that referenced this pull request Jun 3, 2025
joshua-adams-1 pushed a commit to joshua-adams-1/elasticsearch that referenced this pull request Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/ES|QL AKA ESQL auto-backport Automatically create backport pull requests when merged backport pending Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v8.19.0 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants