Skip to content

ESQL: Generative testing with full text functions#142961

Merged
astefan merged 18 commits intoelastic:mainfrom
astefan:generative_full-text-functions
Mar 2, 2026
Merged

ESQL: Generative testing with full text functions#142961
astefan merged 18 commits intoelastic:mainfrom
astefan:generative_full-text-functions

Conversation

@astefan
Copy link
Copy Markdown
Contributor

@astefan astefan commented Feb 24, 2026

This adds support for generative testing for full-text search functions. They are tricky because they have many restrictions. Many of them are already caught and handled in this PR's code.
I've also refactored the functions generation code since the FunctionGenerator became harder to grasp.
Co-authored with AI-tools help.

@astefan astefan added >test Issues or PRs that are addressing/adding tests :Analytics/ES|QL AKA ESQL v9.4.0 labels Feb 24, 2026
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Feb 24, 2026
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

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

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

Thanks @astefan, overall it looks pretty good.
I left a first round of comments.

String errorMessage,
String query,
List<CommandGenerator.CommandDescription> commandsForFieldOriginTracing,
List<CommandGenerator.CommandDescription> commandsForPlacementChecks
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

commandsForPlacementChecks is not used, is it?

private record FailureContext(
String errorMessage,
String query,
List<CommandGenerator.CommandDescription> commandsForFieldOriginTracing,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder if it makes sense to just call it previousCommands. Maybe they will be useful also for other purposes, apart from origin tracing

) {
List<CommandGenerator.CommandDescription> commands = new ArrayList<>(previousCommands.size() + 1);
commands.addAll(previousCommands);
commands.add(commandDescription);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe I'm overlooking something, but I think we don't need this.

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

Thanks @astefan, the changes look correct and super useful IMHO, so LGTM.

The CI is still red, but I'm not sure the failure is related to these changes.
The failing query has a multi_match query in a FORK branch, maybe this is related. Or maybe FORK is just too expensive by itself for the small CI instance.

Anyway, the query looks correct, if there is a bug it's likely not in this PR.

@astefan
Copy link
Copy Markdown
Contributor Author

astefan commented Feb 26, 2026

@luigidellaquila unfortunately one of the failures is a true AssertionError that our own code (not the test infra in generative testing) throws. See #143121

@astefan
Copy link
Copy Markdown
Contributor Author

astefan commented Mar 2, 2026

I have opened #143249 to address the AssertionError encountered earlier.

@astefan astefan merged commit d998c33 into elastic:main Mar 2, 2026
35 checks passed
@astefan astefan deleted the generative_full-text-functions branch March 2, 2026 16:09
szybia added a commit to szybia/elasticsearch that referenced this pull request Mar 2, 2026
…locations

* upstream/main: (94 commits)
  Mute org.elasticsearch.xpack.esql.qa.mixed.EsqlClientYamlIT test {p0=esql/40_tsdb/TS Command grouping on text field} elastic#142544
  Mute org.elasticsearch.index.store.StoreDirectoryMetricsIT testDirectoryMetrics elastic#143419
  Mute org.elasticsearch.xpack.esql.qa.multi_node.GenerativeIT test elastic#143023
  TS_INFO information retrieval command (elastic#142721)
  ESQL: External source parallel execution and distribution (elastic#143349)
  Mute org.elasticsearch.index.mapper.blockloader.FlattenedFieldRootBlockLoaderTests testBlockLoaderForFieldInObject {preference=Params[syntheticSource=false, preference=DOC_VALUES]} elastic#143414
  Mute org.elasticsearch.index.mapper.blockloader.FlattenedFieldRootBlockLoaderTests testBlockLoaderForFieldInObject {preference=Params[syntheticSource=false, preference=NONE]} elastic#143413
  Mute org.elasticsearch.index.mapper.blockloader.FlattenedFieldRootBlockLoaderTests testBlockLoaderForFieldInObject {preference=Params[syntheticSource=false, preference=STORED]} elastic#143412
  Removing ingest random sampling (elastic#143289)
  Mute org.elasticsearch.xpack.esql.qa.single_node.GenerativeIT test elastic#143023
  [Transform] Clean up internal tests (elastic#143246)
  Skip time series field type merge for non-TS agg queries (elastic#143262)
  Enable zero-copy SIMD vector scoring on searchable snapshots (frozen tier) (elastic#141718)
  Mute org.elasticsearch.xpack.search.CrossClusterAsyncSearchIT testCancelViaExpirationOnRemoteResultsWithMinimizeRoundtrips elastic#143407
  Fix MemorySegmentUtilsTests (elastic#143391)
  Unmute testWorkflowsRestrictionAllowsAccess (elastic#143308)
  Cancel async query on expiry (elastic#143016)
  ESQL: Finish migrating error testing (elastic#143322)
  Reduce LuceneOperator.Status memory consumption with large QueryDSL queries (elastic#143175)
  ESQL: Generative testing with full text functions (elastic#142961)
  ...
tballison pushed a commit to tballison/elasticsearch that referenced this pull request Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) >test Issues or PRs that are addressing/adding tests v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants