[8.x] [ES|QL] Update function metadata (#196047) (#196055)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[ES|QL] Update function metadata
(#196047)](https://github.com/elastic/kibana/pull/196047)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Kibana
Machine","email":"42973632+kibanamachine@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-10-14T08:00:47Z","message":"[ES|QL]
Update function metadata (#196047)\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
<efstratia.kalafateli@elastic.co>","sha":"08715c679ae7b573a8ba6631e40eb95e85fba114","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","Feature:ES|QL","Team:ESQL","v8.16.0"],"title":"[ES|QL]
Update function
metadata","number":196047,"url":"https://github.com/elastic/kibana/pull/196047","mergeCommit":{"message":"[ES|QL]
Update function metadata (#196047)\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
<efstratia.kalafateli@elastic.co>","sha":"08715c679ae7b573a8ba6631e40eb95e85fba114"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/196047","number":196047,"mergeCommit":{"message":"[ES|QL]
Update function metadata (#196047)\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
<efstratia.kalafateli@elastic.co>","sha":"08715c679ae7b573a8ba6631e40eb95e85fba114"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
This commit is contained in:
Kibana Machine 2024-10-14 20:53:34 +11:00 committed by GitHub
parent 29c591b9db
commit 24993898e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 292 additions and 0 deletions

View file

@ -2015,6 +2015,263 @@ const greatestDefinition: FunctionDefinition = {
examples: ['ROW a = 10, b = 20\n| EVAL g = GREATEST(a, b)'],
};
// Do not edit this manually... generated by scripts/generate_function_definitions.ts
const hypotDefinition: FunctionDefinition = {
type: 'eval',
name: 'hypot',
description: i18n.translate('kbn-esql-validation-autocomplete.esql.definitions.hypot', {
defaultMessage:
'Returns the hypotenuse of two numbers. The input can be any numeric values, the return value is always a double.\nHypotenuses of infinities are null.',
}),
alias: undefined,
signatures: [
{
params: [
{
name: 'number1',
type: 'double',
optional: false,
},
{
name: 'number2',
type: 'double',
optional: false,
},
],
returnType: 'double',
},
{
params: [
{
name: 'number1',
type: 'double',
optional: false,
},
{
name: 'number2',
type: 'integer',
optional: false,
},
],
returnType: 'double',
},
{
params: [
{
name: 'number1',
type: 'double',
optional: false,
},
{
name: 'number2',
type: 'long',
optional: false,
},
],
returnType: 'double',
},
{
params: [
{
name: 'number1',
type: 'double',
optional: false,
},
{
name: 'number2',
type: 'unsigned_long',
optional: false,
},
],
returnType: 'double',
},
{
params: [
{
name: 'number1',
type: 'integer',
optional: false,
},
{
name: 'number2',
type: 'double',
optional: false,
},
],
returnType: 'double',
},
{
params: [
{
name: 'number1',
type: 'integer',
optional: false,
},
{
name: 'number2',
type: 'integer',
optional: false,
},
],
returnType: 'double',
},
{
params: [
{
name: 'number1',
type: 'integer',
optional: false,
},
{
name: 'number2',
type: 'long',
optional: false,
},
],
returnType: 'double',
},
{
params: [
{
name: 'number1',
type: 'integer',
optional: false,
},
{
name: 'number2',
type: 'unsigned_long',
optional: false,
},
],
returnType: 'double',
},
{
params: [
{
name: 'number1',
type: 'long',
optional: false,
},
{
name: 'number2',
type: 'double',
optional: false,
},
],
returnType: 'double',
},
{
params: [
{
name: 'number1',
type: 'long',
optional: false,
},
{
name: 'number2',
type: 'integer',
optional: false,
},
],
returnType: 'double',
},
{
params: [
{
name: 'number1',
type: 'long',
optional: false,
},
{
name: 'number2',
type: 'long',
optional: false,
},
],
returnType: 'double',
},
{
params: [
{
name: 'number1',
type: 'long',
optional: false,
},
{
name: 'number2',
type: 'unsigned_long',
optional: false,
},
],
returnType: 'double',
},
{
params: [
{
name: 'number1',
type: 'unsigned_long',
optional: false,
},
{
name: 'number2',
type: 'double',
optional: false,
},
],
returnType: 'double',
},
{
params: [
{
name: 'number1',
type: 'unsigned_long',
optional: false,
},
{
name: 'number2',
type: 'integer',
optional: false,
},
],
returnType: 'double',
},
{
params: [
{
name: 'number1',
type: 'unsigned_long',
optional: false,
},
{
name: 'number2',
type: 'long',
optional: false,
},
],
returnType: 'double',
},
{
params: [
{
name: 'number1',
type: 'unsigned_long',
optional: false,
},
{
name: 'number2',
type: 'unsigned_long',
optional: false,
},
],
returnType: 'double',
},
],
supportedCommands: ['stats', 'inlinestats', 'metrics', 'eval', 'where', 'row', 'sort'],
supportedOptions: ['by'],
validate: undefined,
examples: ['ROW a = 3.0, b = 4.0\n| EVAL c = HYPOT(a, b)'],
};
// Do not edit this manually... generated by scripts/generate_function_definitions.ts
const ipPrefixDefinition: FunctionDefinition = {
type: 'eval',
@ -8811,6 +9068,7 @@ export const scalarFunctionDefinitions = [
floorDefinition,
fromBase64Definition,
greatestDefinition,
hypotDefinition,
ipPrefixDefinition,
leastDefinition,
leftDefinition,

View file

@ -834,6 +834,40 @@ export const functions = {
| EVAL g = GREATEST(a, b)
\`\`\`
Note: When run on \`keyword\` or \`text\` fields, this returns the last string in alphabetical order. When run on \`boolean\` columns this will return \`true\` if any values are \`true\`.
`,
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.hypot', {
defaultMessage: 'HYPOT',
}),
description: (
<Markdown
openLinksInNewTab
readOnly
enableSoftLineBreaks
markdownContent={i18n.translate(
'languageDocumentation.documentationESQL.hypot.markdown',
{
defaultMessage: `<!--
This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
-->
### HYPOT
Returns the hypotenuse of two numbers. The input can be any numeric values, the return value is always a double.
Hypotenuses of infinities are null.
\`\`\`
ROW a = 3.0, b = 4.0
| EVAL c = HYPOT(a, b)
\`\`\`
`,
description:
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',