-
Notifications
You must be signed in to change notification settings - Fork 25.2k
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
ES|QL: Add FORK generative tests #129135
Conversation
Pinging @elastic/es-analytical-engine (Team:Analytics) |
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.
LGTM
|
||
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.*; | ||
|
||
public abstract class GenerativeForkRestTest extends EsqlSpecTestCase { |
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 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"; |
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.
👍
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:
EsRelation
(fixed in this PR)PropgateUnmappedFields
( we should fix the typo in the name) does not handle n-ary plans that can multipleEsRelation
- 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.