Skip to content

[ES|QL] Supports TS agg functions#226539

Merged
stratoula merged 12 commits intoelastic:mainfrom
stratoula:timeseries-functions-esql
Jul 9, 2025
Merged

[ES|QL] Supports TS agg functions#226539
stratoula merged 12 commits intoelastic:mainfrom
stratoula:timeseries-functions-esql

Conversation

@stratoula
Copy link
Copy Markdown
Contributor

@stratoula stratoula commented Jul 4, 2025

Summary

Closes #220730

Supports of TS inner agg functions.

  1. Retrieves the functions and the docs from Add tests and docs for first/last_over_time and rate elasticsearch#130290
  2. Suggest them only when an agg is already selected and only if the source command is TS

meow

Atm you won't see any changes in the editor. You can test it though if you change the src/platform/packages/shared/kbn-esql-validation-autocomplete/src/definitions/generated/time_series_agg_functions.ts ignoreAsSuggestion flags to false.

Checklist

}
),
// items are managed by scripts/generate_esql_docs.ts
items: [],
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Empty as all functions are on snapshots atm

args: ESQLAstItem[];
}

export interface ESQLAstTimeseriesCommand extends ESQLCommand<'ts'> {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Kinda irrelevant but the sources property doesnt exist

@stratoula stratoula added v9.2.0 release_note:enhancement backport:skip This PR does not require backporting Feature:ES|QL ES|QL related features in Kibana Team:ESQL ES|QL related features in Kibana t// release_note:skip Skip the PR/issue when compiling release notes and removed release_note:enhancement labels Jul 7, 2025
@stratoula stratoula marked this pull request as ready for review July 7, 2025 11:43
@stratoula stratoula requested review from a team as code owners July 7, 2025 11:43
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-esql (Team:ESQL)

Copy link
Copy Markdown
Contributor

@vadimkibana vadimkibana left a comment

Choose a reason for hiding this comment

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

LGTM, code review only.

…src/autocomplete/autocomplete.ts

Co-authored-by: Vadim Kibana <82822460+vadimkibana@users.noreply.github.com>
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
esql 118 119 +1
lens 1417 1418 +1
lists 512 513 +1
securitySolution 7809 7810 +1
stackAlerts 443 445 +2
unifiedSearch 391 393 +2
total +8

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/esql-ast 505 503 -2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
esql 249.3KB 249.4KB +74.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
kbnUiSharedDeps-srcJs 3.8MB 3.8MB +5.4KB
Unknown metric groups

API count

id before after diff
@kbn/esql-ast 600 598 -2

History

@stratoula stratoula merged commit 320ec37 into elastic:main Jul 9, 2025
12 checks passed
kertal pushed a commit to kertal/kibana that referenced this pull request Jul 25, 2025
## Summary

Closes elastic#220730

Supports of TS inner agg functions.

1. Retrieves the functions and the docs from
elastic/elasticsearch#130290
2. Suggest them only when an agg is already selected and only if the
source command is TS


![meow](https://github.com/user-attachments/assets/9143ff0d-c5ab-4e93-a802-3e535dbc5121)


Atm you won't see any changes in the editor. You can test it though if
you change the
`src/platform/packages/shared/kbn-esql-validation-autocomplete/src/definitions/generated/time_series_agg_functions.ts`
`ignoreAsSuggestion` flags to false.

### Checklist

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Vadim Kibana <82822460+vadimkibana@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:ES|QL ES|QL related features in Kibana release_note:skip Skip the PR/issue when compiling release notes Team:ESQL ES|QL related features in Kibana t// v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ES|QL] Support TS functions

4 participants