Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.x] [ES|QL] Implement `OrderExpression` for `SORT&#x…
…60; command arguments (#189959) (#193379) # Backport This will backport the following commits from `main` to `8.x`: - [[ES|QL] Implement `OrderExpression` for `SORT` command arguments (#189959)](#189959) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Vadim Kibana","email":"82822460+vadimkibana@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-09-19T03:53:05Z","message":"[ES|QL] Implement `OrderExpression` for `SORT` command arguments (#189959)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/189491\r\n\r\n- Adds *order expression* AST nodes, which are minted from `SORT`\r\ncommand.\r\n- Improves SORT command autocomplete suggestions.\r\n\r\nShows fields on first space:\r\n\r\n<img width=\"791\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/3fec96b4-4e61-4212-a856-ace7a33d9755\">\r\n\r\n\r\nIt now shows `NULLS FIRST` and `NULLS LAST`, even before `ASC` or `DESC`\r\nwas entered, as `ASC` and `DESC` are optional:\r\n\r\n<img width=\"871\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/4b6d6c28-a7b0-4ac0-bafc-133df1207d54\">\r\n\r\nOnce `ASC` or `DESC` is entered, shows only nulls options:\r\n\r\n<img width=\"911\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/5b27bd3d-ccdc-4bd0-b09f-fe65e5975e28\">\r\n\r\nIt also now suggests partial modifier, if the in-progress text that user\r\nis typing matches it:\r\n\r\n<img width=\"504\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/9a047c40-b49b-4694-8477-7270cb9c0886\">\r\n\r\n(However, we are not triggering autocomplete in those cases in UI, so no\r\nway to see it in UI right now.)\r\n\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n\r\n### For maintainers\r\n\r\n- [x] This was checked for breaking API changes and was [labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"2efd0f0d8bb9478aec0316d1760adc184feb6309","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["review","release_note:skip","v9.0.0","Team:DataDiscovery","Feature:ES|QL","Team:ESQL","v8.16.0"],"title":"[ES|QL] Implement `OrderExpression` for `SORT` command arguments","number":189959,"url":"https://github.com/elastic/kibana/pull/189959","mergeCommit":{"message":"[ES|QL] Implement `OrderExpression` for `SORT` command arguments (#189959)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/189491\r\n\r\n- Adds *order expression* AST nodes, which are minted from `SORT`\r\ncommand.\r\n- Improves SORT command autocomplete suggestions.\r\n\r\nShows fields on first space:\r\n\r\n<img width=\"791\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/3fec96b4-4e61-4212-a856-ace7a33d9755\">\r\n\r\n\r\nIt now shows `NULLS FIRST` and `NULLS LAST`, even before `ASC` or `DESC`\r\nwas entered, as `ASC` and `DESC` are optional:\r\n\r\n<img width=\"871\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/4b6d6c28-a7b0-4ac0-bafc-133df1207d54\">\r\n\r\nOnce `ASC` or `DESC` is entered, shows only nulls options:\r\n\r\n<img width=\"911\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/5b27bd3d-ccdc-4bd0-b09f-fe65e5975e28\">\r\n\r\nIt also now suggests partial modifier, if the in-progress text that user\r\nis typing matches it:\r\n\r\n<img width=\"504\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/9a047c40-b49b-4694-8477-7270cb9c0886\">\r\n\r\n(However, we are not triggering autocomplete in those cases in UI, so no\r\nway to see it in UI right now.)\r\n\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n\r\n### For maintainers\r\n\r\n- [x] This was checked for breaking API changes and was [labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"2efd0f0d8bb9478aec0316d1760adc184feb6309"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/189959","number":189959,"mergeCommit":{"message":"[ES|QL] Implement `OrderExpression` for `SORT` command arguments (#189959)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/189491\r\n\r\n- Adds *order expression* AST nodes, which are minted from `SORT`\r\ncommand.\r\n- Improves SORT command autocomplete suggestions.\r\n\r\nShows fields on first space:\r\n\r\n<img width=\"791\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/3fec96b4-4e61-4212-a856-ace7a33d9755\">\r\n\r\n\r\nIt now shows `NULLS FIRST` and `NULLS LAST`, even before `ASC` or `DESC`\r\nwas entered, as `ASC` and `DESC` are optional:\r\n\r\n<img width=\"871\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/4b6d6c28-a7b0-4ac0-bafc-133df1207d54\">\r\n\r\nOnce `ASC` or `DESC` is entered, shows only nulls options:\r\n\r\n<img width=\"911\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/5b27bd3d-ccdc-4bd0-b09f-fe65e5975e28\">\r\n\r\nIt also now suggests partial modifier, if the in-progress text that user\r\nis typing matches it:\r\n\r\n<img width=\"504\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/9a047c40-b49b-4694-8477-7270cb9c0886\">\r\n\r\n(However, we are not triggering autocomplete in those cases in UI, so no\r\nway to see it in UI right now.)\r\n\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n\r\n### For maintainers\r\n\r\n- [x] This was checked for breaking API changes and was [labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"2efd0f0d8bb9478aec0316d1760adc184feb6309"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Vadim Kibana <82822460+vadimkibana@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
- Loading branch information