Skip to content

Commit

Permalink
[8.x] [ES|QL] Update function metadata (#193662) (#194524)
Browse files Browse the repository at this point in the history
# Backport

This will backport the following commits from `main` to `8.x`:
- [[ES|QL] Update function metadata
(#193662)](#193662)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Kibana
Machine","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-23T10:00:34Z","message":"[ES|QL]
Update function metadata (#193662)\n\nThis PR updates the function
definitions and inline docs based on the\r\nlatest metadata from
Elasticsearch.\r\n\r\nCo-authored-by: Stratoula Kalafateli
<[email protected]>","sha":"e78ba89cc24c744ccd6137e4d53b10e104f2bd96","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport
missing","v9.0.0","backport:prev-minor","Feature:ES|QL","Team:ESQL"],"number":193662,"url":"https://github.com/elastic/kibana/pull/193662","mergeCommit":{"message":"[ES|QL]
Update function metadata (#193662)\n\nThis PR updates the function
definitions and inline docs based on the\r\nlatest metadata from
Elasticsearch.\r\n\r\nCo-authored-by: Stratoula Kalafateli
<[email protected]>","sha":"e78ba89cc24c744ccd6137e4d53b10e104f2bd96"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193662","number":193662,"mergeCommit":{"message":"[ES|QL]
Update function metadata (#193662)\n\nThis PR updates the function
definitions and inline docs based on the\r\nlatest metadata from
Elasticsearch.\r\n\r\nCo-authored-by: Stratoula Kalafateli
<[email protected]>","sha":"e78ba89cc24c744ccd6137e4d53b10e104f2bd96"}}]}]
BACKPORT-->

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
stratoula and kibanamachine authored Oct 1, 2024
1 parent f14c419 commit 077537c
Show file tree
Hide file tree
Showing 2 changed files with 142 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,42 @@ const atan2Definition: FunctionDefinition = {
examples: ['ROW y=12.9, x=.6\n| EVAL atan2=ATAN2(y, x)'],
};

// Do not edit this manually... generated by scripts/generate_function_definitions.ts
const categorizeDefinition: FunctionDefinition = {
type: 'eval',
name: 'categorize',
description: i18n.translate('kbn-esql-validation-autocomplete.esql.definitions.categorize', {
defaultMessage: 'Categorizes text messages.',
}),
alias: undefined,
signatures: [
{
params: [
{
name: 'field',
type: 'keyword',
optional: false,
},
],
returnType: 'integer',
},
{
params: [
{
name: 'field',
type: 'text',
optional: false,
},
],
returnType: 'integer',
},
],
supportedCommands: ['stats', 'inlinestats', 'metrics', 'eval', 'where', 'row', 'sort'],
supportedOptions: ['by'],
validate: undefined,
examples: [],
};

// Do not edit this manually... generated by scripts/generate_function_definitions.ts
const cbrtDefinition: FunctionDefinition = {
type: 'eval',
Expand Down Expand Up @@ -1256,6 +1292,7 @@ const dateDiffDefinition: FunctionDefinition = {
validate: undefined,
examples: [
'ROW date1 = TO_DATETIME("2023-12-02T11:00:00.000Z"), date2 = TO_DATETIME("2023-12-02T11:00:00.001Z")\n| EVAL dd_ms = DATE_DIFF("microseconds", date1, date2)',
'ROW end_23="2023-12-31T23:59:59.999Z"::DATETIME,\n start_24="2024-01-01T00:00:00.000Z"::DATETIME,\n end_24="2024-12-31T23:59:59.999"::DATETIME\n| EVAL end23_to_start24=DATE_DIFF("year", end_23, start_24)\n| EVAL end23_to_end24=DATE_DIFF("year", end_23, end_24)\n| EVAL start_to_end_24=DATE_DIFF("year", start_24, end_24)',
],
};

Expand Down Expand Up @@ -5434,6 +5471,45 @@ const powDefinition: FunctionDefinition = {
],
};

// Do not edit this manually... generated by scripts/generate_function_definitions.ts
const qstrDefinition: FunctionDefinition = {
type: 'eval',
name: 'qstr',
description: i18n.translate('kbn-esql-validation-autocomplete.esql.definitions.qstr', {
defaultMessage:
'Performs a query string query. Returns true if the provided query string matches the row.',
}),
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 qstr("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 repeatDefinition: FunctionDefinition = {
type: 'eval',
Expand Down Expand Up @@ -8641,6 +8717,7 @@ export const scalarFunctionDefinitions = [
asinDefinition,
atanDefinition,
atan2Definition,
categorizeDefinition,
cbrtDefinition,
ceilDefinition,
cidrMatchDefinition,
Expand Down Expand Up @@ -8687,6 +8764,7 @@ export const scalarFunctionDefinitions = [
nowDefinition,
piDefinition,
powDefinition,
qstrDefinition,
repeatDefinition,
replaceDefinition,
rightDefinition,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,35 @@ export const functions = {
),
},
// Do not edit manually... automatically generated by scripts/generate_esql_docs.ts
{
label: i18n.translate('languageDocumentation.documentationESQL.categorize', {
defaultMessage: 'CATEGORIZE',
}),
description: (
<Markdown
openLinksInNewTab
readOnly
enableSoftLineBreaks
markdownContent={i18n.translate(
'languageDocumentation.documentationESQL.categorize.markdown',
{
defaultMessage: `<!--
This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
-->
### CATEGORIZE
Categorizes text messages.
`,
description:
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
ignoreTag: true,
}
)}
/>
),
},
// Do not edit manually... automatically generated by scripts/generate_esql_docs.ts
{
label: i18n.translate('languageDocumentation.documentationESQL.cbrt', {
defaultMessage: 'CBRT',
Expand Down Expand Up @@ -1161,7 +1190,7 @@ export const functions = {
-->
### MV_AVG
Converts a multivalued field into a single valued field containing the average of all of the values.
Converts a multivalued field into a single valued field containing the average of all the values.
\`\`\`
ROW a=[3, 5, 1, 6]
Expand Down Expand Up @@ -1647,7 +1676,7 @@ export const functions = {
-->
### MV_SUM
Converts a multivalued field into a single valued field containing the sum of all of the values.
Converts a multivalued field into a single valued field containing the sum of all the values.
\`\`\`
ROW a=[3, 5, 6]
Expand Down Expand Up @@ -1777,6 +1806,39 @@ export const functions = {
| EVAL result = POW(base, exponent)
\`\`\`
Note: It is still possible to overflow a double result here; in that case, null will be returned.
`,
description:
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
ignoreTag: true,
})}
/>
),
},
// Do not edit manually... automatically generated by scripts/generate_esql_docs.ts
{
label: i18n.translate('languageDocumentation.documentationESQL.qstr', {
defaultMessage: 'QSTR',
}),
description: (
<Markdown
openLinksInNewTab
readOnly
enableSoftLineBreaks
markdownContent={i18n.translate('languageDocumentation.documentationESQL.qstr.markdown', {
defaultMessage: `<!--
This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
-->
### QSTR
Performs a query string query. Returns true if the provided query string matches the row.
\`\`\`
from books
| where qstr("author: Faulkner")
| keep book_no, author
| sort book_no
| limit 5;
\`\`\`
`,
description:
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
Expand Down

0 comments on commit 077537c

Please sign in to comment.