Skip to content

Commit

Permalink
[8.x] [ES|QL] Update function metadata (#206386) (#206390)
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
(#206386)](#206386)

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

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

<!--BACKPORT [{"author":{"name":"Kibana
Machine","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-13T07:49:37Z","message":"[ES|QL]
Update function metadata (#206386)\n\nThis PR updates the function
definitions and inline docs based on the\r\nlatest metadata from
Elasticsearch.","sha":"455e9bdf2255b11f38b17f7bdf0d8006be107285","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Feature:ES|QL","Team:ESQL","backport:version","v8.18.0"],"title":"[ES|QL]
Update function
metadata","number":206386,"url":"https://github.com/elastic/kibana/pull/206386","mergeCommit":{"message":"[ES|QL]
Update function metadata (#206386)\n\nThis PR updates the function
definitions and inline docs based on the\r\nlatest metadata from
Elasticsearch.","sha":"455e9bdf2255b11f38b17f7bdf0d8006be107285"}},"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/206386","number":206386,"mergeCommit":{"message":"[ES|QL]
Update function metadata (#206386)\n\nThis PR updates the function
definitions and inline docs based on the\r\nlatest metadata from
Elasticsearch.","sha":"455e9bdf2255b11f38b17f7bdf0d8006be107285"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
  • Loading branch information
kibanamachine authored Jan 13, 2025
1 parent 910130e commit 75d5168
Show file tree
Hide file tree
Showing 2 changed files with 265 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,12 @@ export const functions = {
### HASH
Computes the hash of the input using various algorithms such as MD5, SHA, SHA-224, SHA-256, SHA-384, SHA-512.
\`\`\`
FROM sample_data
| WHERE message != "Connection error"
| EVAL md5 = hash("md5", message), sha256 = hash("sha256", message)
| KEEP message, md5, sha256;
\`\`\`
`,
description:
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
Expand Down Expand Up @@ -1073,6 +1079,40 @@ export const functions = {
),
},
// Do not edit manually... automatically generated by scripts/generate_esql_docs.ts
{
label: i18n.translate('languageDocumentation.documentationESQL.kql', {
defaultMessage: 'KQL',
}),
preview: true,
description: (
<Markdown
openLinksInNewTab
readOnly
enableSoftLineBreaks
markdownContent={i18n.translate('languageDocumentation.documentationESQL.kql.markdown', {
defaultMessage: `<!--
This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
-->
### KQL
Performs a KQL query. Returns true if the provided KQL query string matches the row.
\`\`\`
FROM books
| WHERE KQL("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)',
ignoreTag: true,
})}
/>
),
},
// Do not edit manually... automatically generated by scripts/generate_esql_docs.ts
{
label: i18n.translate('languageDocumentation.documentationESQL.least', {
defaultMessage: 'LEAST',
Expand Down Expand Up @@ -1364,6 +1404,39 @@ export const functions = {
),
},
// Do not edit manually... automatically generated by scripts/generate_esql_docs.ts
{
label: i18n.translate('languageDocumentation.documentationESQL.md5', {
defaultMessage: 'MD5',
}),
preview: false,
description: (
<Markdown
openLinksInNewTab
readOnly
enableSoftLineBreaks
markdownContent={i18n.translate('languageDocumentation.documentationESQL.md5.markdown', {
defaultMessage: `<!--
This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
-->
### MD5
Computes the MD5 hash of the input.
\`\`\`
FROM sample_data
| WHERE message != "Connection error"
| EVAL md5 = md5(message)
| KEEP message, md5;
\`\`\`
`,
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.mv_append', {
defaultMessage: 'MV_APPEND',
Expand Down Expand Up @@ -2284,6 +2357,75 @@ export const functions = {
| EVAL message = CONCAT("'", message, "'")
| EVAL color = CONCAT("'", color, "'")
\`\`\`
`,
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.sha1', {
defaultMessage: 'SHA1',
}),
preview: false,
description: (
<Markdown
openLinksInNewTab
readOnly
enableSoftLineBreaks
markdownContent={i18n.translate('languageDocumentation.documentationESQL.sha1.markdown', {
defaultMessage: `<!--
This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
-->
### SHA1
Computes the SHA1 hash of the input.
\`\`\`
FROM sample_data
| WHERE message != "Connection error"
| EVAL sha1 = sha1(message)
| KEEP message, sha1;
\`\`\`
`,
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.sha256', {
defaultMessage: 'SHA256',
}),
preview: false,
description: (
<Markdown
openLinksInNewTab
readOnly
enableSoftLineBreaks
markdownContent={i18n.translate(
'languageDocumentation.documentationESQL.sha256.markdown',
{
defaultMessage: `<!--
This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
-->
### SHA256
Computes the SHA256 hash of the input.
\`\`\`
FROM sample_data
| WHERE message != "Connection error"
| EVAL sha256 = sha256(message)
| KEEP message, sha256;
\`\`\`
`,
description:
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2252,7 +2252,9 @@ const hashDefinition: FunctionDefinition = {
supportedCommands: ['stats', 'inlinestats', 'metrics', 'eval', 'where', 'row', 'sort'],
supportedOptions: ['by'],
validate: undefined,
examples: [],
examples: [
'FROM sample_data \n| WHERE message != "Connection error"\n| EVAL md5 = hash("md5", message), sha256 = hash("sha256", message) \n| KEEP message, md5, sha256;',
],
};

// Do not edit this manually... generated by scripts/generate_function_definitions.ts
Expand Down Expand Up @@ -2560,8 +2562,6 @@ const kqlDefinition: FunctionDefinition = {
defaultMessage:
'Performs a KQL query. Returns true if the provided KQL query string matches the row.',
}),
ignoreAsSuggestion: true,

preview: true,
alias: undefined,
signatures: [
Expand Down Expand Up @@ -4002,6 +4002,45 @@ const matchDefinition: FunctionDefinition = {
],
};

// Do not edit this manually... generated by scripts/generate_function_definitions.ts
const md5Definition: FunctionDefinition = {
type: 'eval',
name: 'md5',
description: i18n.translate('kbn-esql-validation-autocomplete.esql.definitions.md5', {
defaultMessage: 'Computes the MD5 hash of the input.',
}),
preview: false,
alias: undefined,
signatures: [
{
params: [
{
name: 'input',
type: 'keyword',
optional: false,
},
],
returnType: 'keyword',
},
{
params: [
{
name: 'input',
type: 'text',
optional: false,
},
],
returnType: 'keyword',
},
],
supportedCommands: ['stats', 'inlinestats', 'metrics', 'eval', 'where', 'row', 'sort'],
supportedOptions: ['by'],
validate: undefined,
examples: [
'FROM sample_data \n| WHERE message != "Connection error"\n| EVAL md5 = md5(message)\n| KEEP message, md5;',
],
};

// Do not edit this manually... generated by scripts/generate_function_definitions.ts
const mvAppendDefinition: FunctionDefinition = {
type: 'eval',
Expand Down Expand Up @@ -7173,6 +7212,84 @@ const rtrimDefinition: FunctionDefinition = {
],
};

// Do not edit this manually... generated by scripts/generate_function_definitions.ts
const sha1Definition: FunctionDefinition = {
type: 'eval',
name: 'sha1',
description: i18n.translate('kbn-esql-validation-autocomplete.esql.definitions.sha1', {
defaultMessage: 'Computes the SHA1 hash of the input.',
}),
preview: false,
alias: undefined,
signatures: [
{
params: [
{
name: 'input',
type: 'keyword',
optional: false,
},
],
returnType: 'keyword',
},
{
params: [
{
name: 'input',
type: 'text',
optional: false,
},
],
returnType: 'keyword',
},
],
supportedCommands: ['stats', 'inlinestats', 'metrics', 'eval', 'where', 'row', 'sort'],
supportedOptions: ['by'],
validate: undefined,
examples: [
'FROM sample_data \n| WHERE message != "Connection error"\n| EVAL sha1 = sha1(message)\n| KEEP message, sha1;',
],
};

// Do not edit this manually... generated by scripts/generate_function_definitions.ts
const sha256Definition: FunctionDefinition = {
type: 'eval',
name: 'sha256',
description: i18n.translate('kbn-esql-validation-autocomplete.esql.definitions.sha256', {
defaultMessage: 'Computes the SHA256 hash of the input.',
}),
preview: false,
alias: undefined,
signatures: [
{
params: [
{
name: 'input',
type: 'keyword',
optional: false,
},
],
returnType: 'keyword',
},
{
params: [
{
name: 'input',
type: 'text',
optional: false,
},
],
returnType: 'keyword',
},
],
supportedCommands: ['stats', 'inlinestats', 'metrics', 'eval', 'where', 'row', 'sort'],
supportedOptions: ['by'],
validate: undefined,
examples: [
'FROM sample_data \n| WHERE message != "Connection error"\n| EVAL sha256 = sha256(message)\n| KEEP message, sha256;',
],
};

// Do not edit this manually... generated by scripts/generate_function_definitions.ts
const signumDefinition: FunctionDefinition = {
type: 'eval',
Expand Down Expand Up @@ -10519,6 +10636,7 @@ export const scalarFunctionDefinitions = [
log10Definition,
ltrimDefinition,
matchDefinition,
md5Definition,
mvAppendDefinition,
mvAvgDefinition,
mvConcatDefinition,
Expand Down Expand Up @@ -10546,6 +10664,8 @@ export const scalarFunctionDefinitions = [
rightDefinition,
roundDefinition,
rtrimDefinition,
sha1Definition,
sha256Definition,
signumDefinition,
sinDefinition,
sinhDefinition,
Expand Down

0 comments on commit 75d5168

Please sign in to comment.