Skip to content

Commit

Permalink
[ES|QL] Update function metadata (elastic#196047)
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.

Co-authored-by: Stratoula Kalafateli <[email protected]>
  • Loading branch information
kibanamachine and stratoula authored Oct 14, 2024
1 parent 4c4cb1e commit 08715c6
Show file tree
Hide file tree
Showing 2 changed files with 292 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -8811,6 +9068,7 @@ export const scalarFunctionDefinitions = [
floorDefinition,
fromBase64Definition,
greatestDefinition,
hypotDefinition,
ipPrefixDefinition,
leastDefinition,
leftDefinition,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)',
Expand Down

0 comments on commit 08715c6

Please sign in to comment.