Skip to content

ES|QL: Add FORK generative tests #129135

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

Merged
merged 3 commits into from
Jun 10, 2025
Merged

Conversation

ioanatia
Copy link
Contributor

@ioanatia ioanatia commented Jun 9, 2025

tracked in #121950
This adds tests for FORK generated from the current CSV tests.

Tests that are using FORK/RRF already are skipped, since only a single FORK command is allowed for now per ES|QL query.

As a first stage, we just append " | FORK (WHERE true) (WHERE true) | WHERE _fork == \"fork1\" | DROP _fork"; to the test case query. This new query should produce the same results.

By testing this I already uncovered a few things that were not working properly with FORK:

  • the resolution of union types when using a n-ary plan like FORK that can have multiple EsRelation (fixed in this PR)
  • an issue with how we do implicit date nanos casting that is related to a recent change [ES|QL] Date nanos implicit casting in union types option #2 #127797
  • INSIST does not work properly with FORK because PropgateUnmappedFields ( we should fix the typo in the name) does not handle n-ary plans that can multiple EsRelation - these tests we just skip because INSIST is still in snapshot and won't be released any time soon.

While we can always add more tests specific for FORK, we will always play catch up with the other development that is happening in ES|QL. I also don't want think that for changes that seem unrelated to FORK, engineers need to add tests that are using FORK on each PR. However we need to catch any type of regression early in the process, which is why these types of generative tests that reuse the CSV tests we already have are a good middle ground.

@ioanatia ioanatia added >non-issue :Analytics/ES|QL AKA ESQL Team:Search - Relevance The Search organization Search Relevance team v9.1.0 labels Jun 9, 2025
@ioanatia ioanatia marked this pull request as ready for review June 9, 2025 12:40
@elasticsearchmachine elasticsearchmachine added Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) and removed Team:Search - Relevance The Search organization Search Relevance team labels Jun 9, 2025
@elasticsearchmachine
Copy link
Collaborator

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

Copy link
Contributor

@ChrisHegarty ChrisHegarty left a comment

Choose a reason for hiding this comment

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

LGTM


import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.*;

public abstract class GenerativeForkRestTest extends EsqlSpecTestCase {
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be obvious from the query, but maybe add a short description javadoc that summarises the intention.


@Override
protected void doTest() throws Throwable {
String query = testCase.query + " | FORK (WHERE true) (WHERE true) | WHERE _fork == \"fork1\" | DROP _fork";
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@ioanatia ioanatia merged commit 98e9514 into elastic:main Jun 10, 2025
18 checks passed
@ioanatia ioanatia deleted the fork_generative_tests branch June 10, 2025 15:15
@ioanatia ioanatia mentioned this pull request Jun 10, 2025
20 tasks
mridula-s109 pushed a commit to mridula-s109/elasticsearch that referenced this pull request Jun 10, 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 >non-issue 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.

4 participants