Skip to content

[ES|QL] Support by into the Limit command#258008

Merged
bartoval merged 7 commits intoelastic:mainfrom
bartoval:add_limit_by
Mar 19, 2026
Merged

[ES|QL] Support by into the Limit command#258008
bartoval merged 7 commits intoelastic:mainfrom
bartoval:add_limit_by

Conversation

@bartoval
Copy link
Copy Markdown
Contributor

@bartoval bartoval commented Mar 16, 2026

Summary

LIMIT_BY.mp4

@bartoval bartoval self-assigned this Mar 16, 2026
@bartoval bartoval added release_note:skip Skip the PR/issue when compiling release notes 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// v9.4.0 labels Mar 16, 2026
);
const commaSuggestion = withAutoSuggest({ ...commaCompleteItem, text: ', ' });

if (ENDS_WITH_WHITESPACE_REGEX.test(innerText)) {
Copy link
Copy Markdown
Contributor Author

@bartoval bartoval Mar 16, 2026

Choose a reason for hiding this comment

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

removes the space between the previous word and the paragraph. It's the same as what Stats By does

@bartoval
Copy link
Copy Markdown
Contributor Author

bartoval commented Mar 16, 2026

Stats By was considered for refactoring, but it requires special handling to avoid breaking tests. Since that is outside the scope of this PR, it was not included

@bartoval
Copy link
Copy Markdown
Contributor Author

I’m not sure whether I also need to implement ColumnAfter. Stats By passes the custom columns to the next pipe

@bartoval bartoval marked this pull request as ready for review March 17, 2026 06:56
@bartoval bartoval requested a review from a team as a code owner March 17, 2026 06:56
@elasticmachine
Copy link
Copy Markdown
Contributor

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

examples: ['… | LIMIT 100', '… | LIMIT 1'],
preview: true,
// TODO: Remove this temporary autocomplete gate once LIMIT BY is available outside tests.
limitByHidden: process.env.NODE_ENV === 'test' ? false : true,
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.

set this flag to false to try locally the PR

@bartoval bartoval changed the title support by into the Limit command [ES|QL] Support by into the Limit command Mar 17, 2026
kibanamachine and others added 2 commits March 17, 2026 09:46
…ally, or add an exception to src/dev/yarn_deduplicate/index.ts and then commit the changes and push to your branch
Copy link
Copy Markdown
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

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

Looks awesome, jsut a small change, do not suggest the grouping options for now as they are not going to be supported for 9.4

},
],
locationsAvailable: [Location.STATS, Location.STATS_BY],
locationsAvailable: [Location.STATS, Location.STATS_BY, Location.LIMIT_BY],
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.

Here we shuld not have the locations right? Because the grouping functions are not supported in tech preview

Copy link
Copy Markdown
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

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

Thanks Val

Copy link
Copy Markdown
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

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

🎉

@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 964 965 +1

Async chunks

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

id before after diff
esql 791.9KB 792.0KB +22.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-npmDll 7.0MB 7.0MB +771.0B
kbnUiSharedDeps-srcJs 4.1MB 4.1MB +3.4KB
total +4.2KB

History

cc @bartoval

@bartoval bartoval merged commit f5ae7bf into elastic:main Mar 19, 2026
19 checks passed
jeramysoucy pushed a commit to jeramysoucy/kibana that referenced this pull request Mar 26, 2026
## Summary


https://github.com/user-attachments/assets/a2fc7656-935d-4b62-88cc-05418d321b6b

- The BY part of the LIMIT command is currently flagged as
development-only, so it needs to be hidden
- A mysterious voice says that LIMIT BY cannot come before SORT, so we
added a validation and temporarily do not suggest it
elastic/elasticsearch#144069

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Stratou <efstratia.kalafateli@elastic.co>
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.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants