Skip to content

Conversation

luigidellaquila
Copy link
Contributor

Adding include_execution_metadata parameter to ES|QL query specification.
See elastic/elasticsearch#134446

Closes: #5299

@luigidellaquila luigidellaquila added specification skip-backport This pull request should not be backported labels Sep 22, 2025
Copy link
Contributor

Following you can find the validation changes against the target branch for the APIs.

No changes detected.

You can validate these APIs yourself by using the make validate target.

Copy link
Contributor

@quux00 quux00 left a comment

Choose a reason for hiding this comment

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

LGTM

@l-trotta
Copy link
Contributor

thanks for the contribution @luigidellaquila! considering include_ccs_metadata and include_execution_metadata are synonyms and share the exact same description, I think it makes sense to add include_execution_metadata as an alias of the existing include_ccs_metadata:

...
 * @server_default false
 * @aliases include_execution_metadata
 */
include_ccs_metadata?: boolean

Also, should this be in specification/esql/async_query/AsyncQueryRequest.ts too?

@luigidellaquila
Copy link
Contributor Author

luigidellaquila commented Sep 23, 2025

Thanks for checking @l-trotta
Since from now on we want include_execution_metadata to be the preferred way, do you think it makes sense to do it the other way around, ie. have include_ccs_metadata as an alias for include_execution_metadata? Or is it unusual since include_ccs_metadata was already there?

Or maybe we should keep both with the respective @alias definitions?

"type": "boolean"
},
"include_execution_metadata": {
"description": "When set to `true` and performing a cross-cluster or cross-project query, the response will include an extra `_clusters`\nobject with information about the clusters that participated in the search along with info such as shards\ncount.\nThis is a synonym for `include_ccs_metadata`, the two parameters can be used interchangeably but not together.",

Choose a reason for hiding this comment

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

I am not very familiar with this project, but since we have a distinct file for serverless, should the regular one not include include_execution_metadata?

Copy link
Contributor

Choose a reason for hiding this comment

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

if include_execution_metadata has not been marked as only available in stack or serverless, then it will be added to both files

Copy link
Contributor Author

Choose a reason for hiding this comment

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

include_execution_metadata will be available in stateful as well, so I guess it's fine to have a single definition with

 * @availability stack ...
 * @availability serverless

@luigidellaquila
Copy link
Contributor Author

OK, I went for just adding @aliases to the existing parameters.
@l-trotta in case you want to have another look

@l-trotta
Copy link
Contributor

l-trotta commented Sep 23, 2025

@luigidellaquila thanks for the changes! I'll just quickly check with the team because I need to make sure this won't be a breaking change when include_ccs_metadata gets removed. LGTM!

@luigidellaquila
Copy link
Contributor Author

Thanks all! Merging

@luigidellaquila luigidellaquila merged commit 5796da6 into main Sep 23, 2025
8 checks passed
@luigidellaquila luigidellaquila deleted the esql/include_execution_metadata branch September 23, 2025 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-backport This pull request should not be backported specification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add include_execution_metadata to ES|QL query spec
4 participants