Skip to content

Commit 58b685e

Browse files
[ES|QL] Update function metadata (elastic#245490)
This PR updates the function definitions and inline docs based on the latest metadata from Elasticsearch. --------- Co-authored-by: Stratou <efstratia.kalafateli@elastic.co>
1 parent d19914f commit 58b685e

5 files changed

Lines changed: 35 additions & 12 deletions

File tree

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

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,30 @@ export const functions = {
283283
ROW a=1.8
284284
| EVAL a=CEIL(a)
285285
\`\`\`
286+
`,
287+
description:
288+
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
289+
ignoreTag: true,
290+
}),
291+
},
292+
},
293+
// Do not edit manually... automatically generated by scripts/generate_esql_docs.ts
294+
{
295+
label: i18n.translate('languageDocumentation.documentationESQL.chunk', {
296+
defaultMessage: 'CHUNK',
297+
}),
298+
preview: true,
299+
license: undefined,
300+
description: {
301+
markdownContent: i18n.translate('languageDocumentation.documentationESQL.chunk.markdown', {
302+
defaultMessage: `
303+
### CHUNK
304+
Use \`CHUNK\` to split a text field into smaller chunks.
305+
306+
\`\`\`esql
307+
FROM books
308+
| EVAL chunks = CHUNK(description)
309+
\`\`\`
286310
`,
287311
description:
288312
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
@@ -329,7 +353,7 @@ export const functions = {
329353
markdownContent: i18n.translate('languageDocumentation.documentationESQL.clamp.markdown', {
330354
defaultMessage: `
331355
### CLAMP
332-
Clamps the values of all samples to have a lower limit of min and an upper limit of max.
356+
Limits (or clamps) the values of all samples to have a lower limit of min and an upper limit of max.
333357
334358
\`\`\`esql
335359
TS k8s
@@ -356,7 +380,7 @@ export const functions = {
356380
{
357381
defaultMessage: `
358382
### CLAMP MAX
359-
Returns clamps the values of all input samples clamped to have an upper limit of max.
383+
Limits (or clamps) all input sample values to an upper bound of max. Any value above max is reduced to max.
360384
361385
\`\`\`esql
362386
TS k8s
@@ -383,7 +407,7 @@ export const functions = {
383407
{
384408
defaultMessage: `
385409
### CLAMP MIN
386-
Returns clamps the values of all input samples clamped to have a lower limit of min.
410+
Limits (or clamps) all input sample values to a lower bound of min. Any value below min is set to min.
387411
388412
\`\`\`esql
389413
FROM k8s

src/platform/packages/private/kbn-language-documentation/src/sections/generated/timeseries_aggregation_functions.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export const functions = {
163163
label: i18n.translate('languageDocumentation.documentationESQL.deriv', {
164164
defaultMessage: 'DERIV',
165165
}),
166-
preview: false,
166+
preview: true,
167167
license: undefined,
168168
description: {
169169
markdownContent: i18n.translate('languageDocumentation.documentationESQL.deriv.markdown', {
@@ -172,7 +172,7 @@ export const functions = {
172172
Calculates the derivative over time of a numeric field using linear regression.
173173
174174
\`\`\`esql
175-
TS k8s
175+
TS datenanos-k8s
176176
| WHERE pod == "three"
177177
| STATS max_deriv = MAX(DERIV(network.cost)) BY time_bucket = BUCKET(@timestamp,5minute), pod
178178
\`\`\`

src/platform/packages/shared/kbn-esql-ast/src/definitions/generated/scalar_functions.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,6 @@ const chunkDefinition: FunctionDefinition = {
811811
description: i18n.translate('kbn-esql-ast.esql.definitions.chunk', {
812812
defaultMessage: 'Use `CHUNK` to split a text field into smaller chunks.',
813813
}),
814-
ignoreAsSuggestion: true,
815814
preview: true,
816815
alias: undefined,
817816
signatures: [
@@ -923,7 +922,7 @@ const clampDefinition: FunctionDefinition = {
923922
name: 'clamp',
924923
description: i18n.translate('kbn-esql-ast.esql.definitions.clamp', {
925924
defaultMessage:
926-
'Clamps the values of all samples to have a lower limit of min and an upper limit of max.',
925+
'Limits (or clamps) the values of all samples to have a lower limit of min and an upper limit of max.',
927926
}),
928927
preview: false,
929928
alias: undefined,
@@ -1373,7 +1372,7 @@ const clampMaxDefinition: FunctionDefinition = {
13731372
name: 'clamp_max',
13741373
description: i18n.translate('kbn-esql-ast.esql.definitions.clamp_max', {
13751374
defaultMessage:
1376-
'Returns clamps the values of all input samples clamped to have an upper limit of max.',
1375+
'Limits (or clamps) all input sample values to an upper bound of max. Any value above max is reduced to max.',
13771376
}),
13781377
preview: false,
13791378
alias: undefined,
@@ -1718,7 +1717,7 @@ const clampMinDefinition: FunctionDefinition = {
17181717
name: 'clamp_min',
17191718
description: i18n.translate('kbn-esql-ast.esql.definitions.clamp_min', {
17201719
defaultMessage:
1721-
'Returns clamps the values of all input samples clamped to have a lower limit of min.',
1720+
'Limits (or clamps) all input sample values to a lower bound of min. Any value below min is set to min.',
17221721
}),
17231722
preview: false,
17241723
alias: undefined,

src/platform/packages/shared/kbn-esql-ast/src/definitions/generated/settings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const projectRouting = {
1212
name: 'project_routing',
1313
type: 'keyword',
1414
serverlessOnly: true,
15-
preview: false,
15+
preview: true,
1616
snapshotOnly: true,
1717
description:
1818
'A project routing expression, used to define which projects to route the query to. Only supported if Cross-Project Search is enabled.',

src/platform/packages/shared/kbn-esql-ast/src/definitions/generated/time_series_agg_functions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,7 +1143,7 @@ const derivDefinition: FunctionDefinition = {
11431143
defaultMessage:
11441144
'Calculates the derivative over time of a numeric field using linear regression.',
11451145
}),
1146-
preview: false,
1146+
preview: true,
11471147
alias: undefined,
11481148
signatures: [
11491149
{
@@ -1179,7 +1179,7 @@ const derivDefinition: FunctionDefinition = {
11791179
],
11801180
locationsAvailable: [Location.STATS_TIMESERIES],
11811181
examples: [
1182-
'TS k8s\n| WHERE pod == "three"\n| STATS max_deriv = MAX(DERIV(network.cost)) BY time_bucket = BUCKET(@timestamp,5minute), pod',
1182+
'TS datenanos-k8s\n| WHERE pod == "three"\n| STATS max_deriv = MAX(DERIV(network.cost)) BY time_bucket = BUCKET(@timestamp,5minute), pod',
11831183
],
11841184
};
11851185

0 commit comments

Comments
 (0)