From 6ef4912c65e031f3b21adfba559de8d4295a16a1 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Mon, 2 Dec 2024 18:10:32 +1100 Subject: [PATCH] [ES|QL] Update function metadata (#202395) This PR updates the function definitions and inline docs based on the latest metadata from Elasticsearch. --- .../definitions/generated/scalar_functions.ts | 47 ++++++++++++++++++- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/packages/kbn-esql-validation-autocomplete/src/definitions/generated/scalar_functions.ts b/packages/kbn-esql-validation-autocomplete/src/definitions/generated/scalar_functions.ts index d45271b189915..d76b4d9b03ad9 100644 --- a/packages/kbn-esql-validation-autocomplete/src/definitions/generated/scalar_functions.ts +++ b/packages/kbn-esql-validation-autocomplete/src/definitions/generated/scalar_functions.ts @@ -620,7 +620,7 @@ const categorizeDefinition: FunctionDefinition = { optional: false, }, ], - returnType: 'integer', + returnType: 'keyword', }, { params: [ @@ -630,7 +630,7 @@ const categorizeDefinition: FunctionDefinition = { optional: false, }, ], - returnType: 'integer', + returnType: 'keyword', }, ], supportedCommands: ['stats', 'inlinestats', 'metrics', 'eval', 'where', 'row', 'sort'], @@ -2476,6 +2476,48 @@ const ipPrefixDefinition: FunctionDefinition = { ], }; +// Do not edit this manually... generated by scripts/generate_function_definitions.ts +const kqlDefinition: FunctionDefinition = { + type: 'eval', + name: 'kql', + description: i18n.translate('kbn-esql-validation-autocomplete.esql.definitions.kql', { + defaultMessage: + 'Performs a KQL query. Returns true if the provided KQL query string matches the row.', + }), + ignoreAsSuggestion: true, + + preview: true, + alias: undefined, + signatures: [ + { + params: [ + { + name: 'query', + type: 'keyword', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'query', + type: 'text', + optional: false, + }, + ], + returnType: 'boolean', + }, + ], + supportedCommands: ['stats', 'inlinestats', 'metrics', 'eval', 'where', 'row', 'sort'], + supportedOptions: ['by'], + validate: undefined, + examples: [ + 'FROM books \n| WHERE KQL("author: Faulkner")\n| KEEP book_no, author \n| SORT book_no \n| LIMIT 5;', + ], +}; + // Do not edit this manually... generated by scripts/generate_function_definitions.ts const leastDefinition: FunctionDefinition = { type: 'eval', @@ -9612,6 +9654,7 @@ export const scalarFunctionDefinitions = [ greatestDefinition, hypotDefinition, ipPrefixDefinition, + kqlDefinition, leastDefinition, leftDefinition, lengthDefinition,