Skip to content

Commit

Permalink
[ES|QL] Update function metadata (elastic#202395)
Browse files Browse the repository at this point in the history
This PR updates the function definitions and inline docs based on the
latest metadata from Elasticsearch.
  • Loading branch information
kibanamachine authored Dec 2, 2024
1 parent e2a99ca commit 6ef4912
Showing 1 changed file with 45 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ const categorizeDefinition: FunctionDefinition = {
optional: false,
},
],
returnType: 'integer',
returnType: 'keyword',
},
{
params: [
Expand All @@ -630,7 +630,7 @@ const categorizeDefinition: FunctionDefinition = {
optional: false,
},
],
returnType: 'integer',
returnType: 'keyword',
},
],
supportedCommands: ['stats', 'inlinestats', 'metrics', 'eval', 'where', 'row', 'sort'],
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -9612,6 +9654,7 @@ export const scalarFunctionDefinitions = [
greatestDefinition,
hypotDefinition,
ipPrefixDefinition,
kqlDefinition,
leastDefinition,
leftDefinition,
lengthDefinition,
Expand Down

0 comments on commit 6ef4912

Please sign in to comment.