Skip to content

ESQL: Rework FieldExtractorIT's pragmas #127117

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 11 commits into from
Apr 30, 2025

Conversation

nik9000
Copy link
Member

@nik9000 nik9000 commented Apr 21, 2025

This reworks the way FieldExtractorIT requests fields to be loaded. Previously it used pragmas and would skip itself if it wasn't a unit test. This removes that behavior and sends pragmas but also sends the accept_pragma_risks option which is used in production releases to allow pragmas - it's especially useful for testing. This should make the tests more consistent.

Closes #127100

This reworks the way `FieldExtractorIT` requests fields to be loaded.
Previously it used pragmas and would skip itself if it wasn't a unit
test. This removes that behavior and sends pragmas but also sends the
`accept_pragma_risks` option which is used in production releases to
allow pragmas - it's especially useful for testing. This *should* make
the tests more consistent.

Closes elastic#127100
@nik9000 nik9000 added >test Issues or PRs that are addressing/adding tests auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) auto-backport Automatically create backport pull requests when merged test-release Trigger CI checks against release build v9.0.0 v8.18.1 v8.19.0 v9.1.0 labels Apr 21, 2025
@elasticsearchmachine elasticsearchmachine added the needs:triage Requires assignment of a team area label label Apr 21, 2025
@nik9000 nik9000 added the :Analytics/ES|QL AKA ESQL label Apr 21, 2025
@elasticsearchmachine elasticsearchmachine added Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) and removed needs:triage Requires assignment of a team area label labels Apr 21, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@@ -1766,6 +1753,7 @@ private Map<String, Object> runEsql(String query) throws IOException {
request = request.pragmas(
Settings.builder().put(QueryPragmas.FIELD_EXTRACT_PREFERENCE.getKey(), preference.toString()).build()
);
request.pragmasOk();
Copy link
Member

Choose a reason for hiding this comment

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

I think we need to guard this for 8.16+ because accept_pragma_risks is only available in 8.16+, and FieldExtractorTestCase can run in a mixed cluster.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good call.

@nik9000
Copy link
Member Author

nik9000 commented Apr 22, 2025

The release test failures are build failures because it wants a release copy of metricbeat which is not yet available. Fun.

@nik9000
Copy link
Member Author

nik9000 commented Apr 22, 2025

Serverless failure is real. Checking.

Copy link
Member

@dnhatn dnhatn 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 Nik!

@nik9000
Copy link
Member Author

nik9000 commented Apr 24, 2025

elasticsearch-ci/checkPart1 / release-tests

This is a spurious failure. I'm ignoring it. Let's see how many more we get like this.

@nik9000 nik9000 merged commit c90766d into elastic:main Apr 30, 2025
16 of 20 checks passed
@nik9000 nik9000 deleted the esql_test_another_Way branch April 30, 2025 00:57
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
9.0 Commit could not be cherrypicked due to conflicts
8.18 Commit could not be cherrypicked due to conflicts
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 127117

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 auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport pending Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) >test Issues or PRs that are addressing/adding tests test-release Trigger CI checks against release build v8.18.1 v8.19.0 v9.0.0 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CI] FieldExtractorIT class failing
3 participants