Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x] [ES|QL] Update function metadata (#193662) #194524

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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