Skip to content

Commit a0e118d

Browse files
[8.x] [ES|QL] Update function metadata (#195175) (#195194)
# Backport This will backport the following commits from `main` to `8.x`: - [[ES|QL] Update function metadata (#195175)](#195175) <!--- 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-07T08:58:10Z","message":"[ES|QL] Update function metadata (#195175)\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":"c392aba39feb84b89c132cc00b4b82ec500c2700","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":195175,"url":"https://github.com/elastic/kibana/pull/195175","mergeCommit":{"message":"[ES|QL] Update function metadata (#195175)\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":"c392aba39feb84b89c132cc00b4b82ec500c2700"}},"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/195175","number":195175,"mergeCommit":{"message":"[ES|QL] Update function metadata (#195175)\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":"c392aba39feb84b89c132cc00b4b82ec500c2700"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
1 parent 49ec768 commit a0e118d

File tree

2 files changed

+104
-0
lines changed

2 files changed

+104
-0
lines changed

packages/kbn-esql-validation-autocomplete/src/definitions/generated/scalar_functions.ts

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1834,6 +1834,22 @@ const greatestDefinition: FunctionDefinition = {
18341834
returnType: 'boolean',
18351835
minParams: 1,
18361836
},
1837+
{
1838+
params: [
1839+
{
1840+
name: 'first',
1841+
type: 'date',
1842+
optional: false,
1843+
},
1844+
{
1845+
name: 'rest',
1846+
type: 'date',
1847+
optional: true,
1848+
},
1849+
],
1850+
returnType: 'date',
1851+
minParams: 1,
1852+
},
18371853
{
18381854
params: [
18391855
{
@@ -2072,6 +2088,22 @@ const leastDefinition: FunctionDefinition = {
20722088
returnType: 'boolean',
20732089
minParams: 1,
20742090
},
2091+
{
2092+
params: [
2093+
{
2094+
name: 'first',
2095+
type: 'date',
2096+
optional: false,
2097+
},
2098+
{
2099+
name: 'rest',
2100+
type: 'date',
2101+
optional: true,
2102+
},
2103+
],
2104+
returnType: 'date',
2105+
minParams: 1,
2106+
},
20752107
{
20762108
params: [
20772109
{
@@ -5734,6 +5766,45 @@ const replaceDefinition: FunctionDefinition = {
57345766
examples: ['ROW str = "Hello World"\n| EVAL str = REPLACE(str, "World", "Universe")\n| KEEP str'],
57355767
};
57365768

5769+
// Do not edit this manually... generated by scripts/generate_function_definitions.ts
5770+
const reverseDefinition: FunctionDefinition = {
5771+
type: 'eval',
5772+
name: 'reverse',
5773+
description: i18n.translate('kbn-esql-validation-autocomplete.esql.definitions.reverse', {
5774+
defaultMessage: 'Returns a new string representing the input string in reverse order.',
5775+
}),
5776+
alias: undefined,
5777+
signatures: [
5778+
{
5779+
params: [
5780+
{
5781+
name: 'str',
5782+
type: 'keyword',
5783+
optional: false,
5784+
},
5785+
],
5786+
returnType: 'keyword',
5787+
},
5788+
{
5789+
params: [
5790+
{
5791+
name: 'str',
5792+
type: 'text',
5793+
optional: false,
5794+
},
5795+
],
5796+
returnType: 'text',
5797+
},
5798+
],
5799+
supportedCommands: ['stats', 'inlinestats', 'metrics', 'eval', 'where', 'row', 'sort'],
5800+
supportedOptions: ['by'],
5801+
validate: undefined,
5802+
examples: [
5803+
'ROW message = "Some Text" | EVAL message_reversed = REVERSE(message);',
5804+
'ROW bending_arts = "💧🪨🔥💨" | EVAL bending_arts_reversed = REVERSE(bending_arts);',
5805+
],
5806+
};
5807+
57375808
// Do not edit this manually... generated by scripts/generate_function_definitions.ts
57385809
const rightDefinition: FunctionDefinition = {
57395810
type: 'eval',
@@ -8767,6 +8838,7 @@ export const scalarFunctionDefinitions = [
87678838
qstrDefinition,
87688839
repeatDefinition,
87698840
replaceDefinition,
8841+
reverseDefinition,
87708842
rightDefinition,
87718843
roundDefinition,
87728844
rtrimDefinition,

packages/kbn-language-documentation/src/sections/generated/scalar_functions.tsx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1906,6 +1906,38 @@ export const functions = {
19061906
| EVAL str = REPLACE(str, "World", "Universe")
19071907
| KEEP str
19081908
\`\`\`
1909+
`,
1910+
description:
1911+
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
1912+
ignoreTag: true,
1913+
}
1914+
)}
1915+
/>
1916+
),
1917+
},
1918+
// Do not edit manually... automatically generated by scripts/generate_esql_docs.ts
1919+
{
1920+
label: i18n.translate('languageDocumentation.documentationESQL.reverse', {
1921+
defaultMessage: 'REVERSE',
1922+
}),
1923+
description: (
1924+
<Markdown
1925+
openLinksInNewTab
1926+
readOnly
1927+
enableSoftLineBreaks
1928+
markdownContent={i18n.translate(
1929+
'languageDocumentation.documentationESQL.reverse.markdown',
1930+
{
1931+
defaultMessage: `<!--
1932+
This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
1933+
-->
1934+
1935+
### REVERSE
1936+
Returns a new string representing the input string in reverse order.
1937+
1938+
\`\`\`
1939+
ROW message = "Some Text" | EVAL message_reversed = REVERSE(message);
1940+
\`\`\`
19091941
`,
19101942
description:
19111943
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',

0 commit comments

Comments
 (0)