Skip to content

Conversation

@idegtiarenko
Copy link
Contributor

@idegtiarenko idegtiarenko commented Nov 21, 2025

EsqlQueryRequest is structured as a mutable class with builder like setters.
There are 2 factory methods to create an instance: syncEsqlQueryRequest and asyncEsqlQueryRequest.

This change makes those to accept a query parameter as this is the only mandatory field in the request as well as fixes several setters to be builder like.
This is intended to make it obvious that query is mandatory and shorten overall query initialization chain.

For example syncEsqlQueryRequest().query("FROM *") becomes syncEsqlQueryRequest("FROM *")

@idegtiarenko idegtiarenko added >non-issue Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) :Analytics/ES|QL AKA ESQL v9.3.0 labels Nov 21, 2025
@elasticsearchmachine
Copy link
Collaborator

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

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

I like it!

We could probably consider to backport it, if it's not too much effort, to avoid conflicts in the future (the change is simple, but it impacts many files)

@idegtiarenko idegtiarenko added auto-backport Automatically create backport pull requests when merged v8.19.0 v9.2.0 labels Nov 21, 2025
@elasticsearchmachine elasticsearchmachine added the serverless-linked Added by automation, don't add manually label Nov 21, 2025
Copy link
Contributor

@ivancea ivancea left a comment

Choose a reason for hiding this comment

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

Thanks, looks good!
+1 to backporting, if not too troublesome

* For secret access to ES|QL internals only. Do not use.
* TODO qualify export when ES|QL is modularized
*/
public class SharedSecrets {
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this unused?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was only used in EsqlQueryRequestBuilder. I am not convinced we need it.

Copy link
Contributor

@bpintea bpintea left a comment

Choose a reason for hiding this comment

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

LGTM

@idegtiarenko idegtiarenko merged commit daab115 into elastic:main Nov 24, 2025
34 checks passed
@idegtiarenko idegtiarenko deleted the mandatory_query_field branch November 24, 2025 11:46
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

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

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

idegtiarenko added a commit to idegtiarenko/elasticsearch that referenced this pull request Nov 24, 2025
idegtiarenko added a commit to idegtiarenko/elasticsearch that referenced this pull request Nov 24, 2025
@idegtiarenko
Copy link
Contributor Author

Opened a 9.2 backport.
8.19 causes 25 file conflicts. I will take a look if it is feasible to backport

elasticsearchmachine pushed a commit that referenced this pull request Nov 24, 2025
szybia added a commit to szybia/elasticsearch that referenced this pull request Nov 24, 2025
…-json

* upstream/main: (247 commits)
  Mute org.elasticsearch.xpack.inference.integration.SemanticTextIndexOptionsIT testValidateIndexOptionsWithBasicLicense elastic#138513
  Mute org.elasticsearch.xpack.esql.heap_attack.HeapAttackLookupJoinIT testLookupExplosionBigString elastic#138510
  This shouldn't be zero (elastic#138501)
  sum of empty histogram is now null (elastic#138378)
  Test ES|QL bfloat16 support (elastic#138499)
  Fix exception handling in S3 `compareAndExchangeRegister` (elastic#138488)
  Mute org.elasticsearch.xpack.exponentialhistogram.ExponentialHistogramFieldMapperTests testFormattedDocValues elastic#138504
  Mute org.elasticsearch.ingest.geoip.IngestGeoIpClientYamlTestSuiteIT test {yaml=ingest_geoip/60_ip_location_databases/Test adding, getting, and removing ip location databases} elastic#138502
  ESQL: Refactor HeapAttackIT (elastic#138432)
  [Inference API] Add ElasticInferenceServiceDenseTextEmbeddingsServiceSettings to InferenceNamedWriteablesProvider (elastic#138484)
  Store split indices (elastic#138396)
  ES|QL Update CHUNK to support chunking_settings as optional argument (elastic#138123)
  Extract common blob-update logic in `S3HttpHandler` (elastic#138490)
  Cleanup esql request building api (elastic#138398)
  Round sum and avg in exponential_histogram CSV tests (elastic#138472)
  ESQL: load exponential_histogram total count as double instead of long (elastic#138417)
  [SIMD] Use fixed width native types for better Java interoperability (elastic#138429)
  Do not use Min or Max as Top's surrogate when there is an outputField (elastic#138380)
  ES|QL: Fix generative tests (elastic#138478)
  Mute org.elasticsearch.xpack.inference.integration.AuthorizationTaskExecutorIT testCreatesEisChatCompletion_DoesNotRemoveEndpointWhenNoLongerAuthorized elastic#138480
  ...
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 >non-issue serverless-linked Added by automation, don't add manually Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v8.19.0 v9.2.0 v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants