[ES|QL] support expressions in STATS#229513
Conversation
| offset?: number | ||
| ): Promise<ISuggestionItem[]> => { | ||
| const correctedQuery = correctQuerySyntax(query); | ||
| const innerText = query.substring(0, offset ?? query.length); |
There was a problem hiding this comment.
This step that is executed in the real autocomplete routine was missed here, causing one of my tests to fail.
| } | ||
| if ( | ||
| isNotEnrichClauseAssigment(node, command) && | ||
| (!isOperator(node) || (command.name === 'stats' && !withinStatsWhereClause)) |
There was a problem hiding this comment.
This exception was designed to partially support suggestions after operators using the logic in getFunctionArgsSuggestions. Now, we are using the suggestForExpression function, so no need for this partial support anymore.
…daemon/kibana into 216492/support-expressions-in-stats
fd45c47 to
62d9f84
Compare
|
Pinging @elastic/kibana-esql (Team:ESQL) |
| * License v3.0 only", or the "Server Side Public License, v 1". | ||
| */ | ||
| import { ESQLVariableType } from '@kbn/esql-types'; | ||
| // import { getInsideFunctionsSuggestions } from '../../../definitions/utils/autocomplete/functions'; |
There was a problem hiding this comment.
| // import { getInsideFunctionsSuggestions } from '../../../definitions/utils/autocomplete/functions'; |
| defaultMessage: 'WHERE operator', | ||
| }), | ||
| locationsAvailable: [Location.STATS], | ||
| ignoreAsSuggestion: true, |
There was a problem hiding this comment.
Why don't we remove it once and for all and we add the flag instead?
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
Page load bundle
History
|
## Summary Adds first-class support for expressions within both aggregation and grouping clauses in `STATS`. https://github.com/user-attachments/assets/a435410f-9176-47d5-9ca2-412a2438e197 Part of elastic#216492 ### Checklist - [x] [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 - [x] Reinstate controls suggestions - [x] Behavior after single field in grouping clauses - [x] Reenable function arg suggestions - [x] Ignore previously-used columns in grouping clauses - [x] Verify suggestions after complete WHERE - [x] Verify nested grouping functions - [x] Write tests --------- Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
## Summary Adds first-class support for expressions within both aggregation and grouping clauses in `STATS`. https://github.com/user-attachments/assets/a435410f-9176-47d5-9ca2-412a2438e197 Part of elastic#216492 ### Checklist - [x] [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 - [x] Reinstate controls suggestions - [x] Behavior after single field in grouping clauses - [x] Reenable function arg suggestions - [x] Ignore previously-used columns in grouping clauses - [x] Verify suggestions after complete WHERE - [x] Verify nested grouping functions - [x] Write tests --------- Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
## Summary Adds first-class support for expressions within both aggregation and grouping clauses in `STATS`. https://github.com/user-attachments/assets/a435410f-9176-47d5-9ca2-412a2438e197 Part of elastic#216492 ### Checklist - [x] [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 - [x] Reinstate controls suggestions - [x] Behavior after single field in grouping clauses - [x] Reenable function arg suggestions - [x] Ignore previously-used columns in grouping clauses - [x] Verify suggestions after complete WHERE - [x] Verify nested grouping functions - [x] Write tests --------- Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
Summary
Adds first-class support for expressions within both aggregation and grouping clauses in
STATS.expressions_in_stats.mov
Part of #216492
Checklist