Skip to content

Commit d18184c

Browse files
[ES|QL] Update function metadata (elastic#229648)
This PR updates the function definitions and inline docs based on the latest metadata from Elasticsearch. --------- Co-authored-by: Stratoula <[email protected]>
1 parent 1690525 commit d18184c

File tree

6 files changed

+186
-2
lines changed

6 files changed

+186
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1257,7 +1257,7 @@ export const functions = {
12571257
markdownContent={i18n.translate('languageDocumentation.documentationESQL.md5.markdown', {
12581258
defaultMessage: `
12591259
### MD5
1260-
Computes the MD5 hash of the input.
1260+
Computes the MD5 hash of the input (if the MD5 hash is available on the JVM).
12611261
12621262
\`\`\`esql
12631263
FROM sample_data

src/platform/packages/shared/kbn-esql-ast/src/commands_registry/commands/stats/autocomplete.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ describe('STATS Autocomplete', () => {
322322
'text',
323323
'keyword',
324324
'date_nanos',
325+
'unsigned_long',
325326
],
326327
{
327328
scalar: true,

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

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,16 @@ const countDefinition: FunctionDefinition = {
110110
],
111111
returnType: 'long',
112112
},
113+
{
114+
params: [
115+
{
116+
name: 'field',
117+
type: 'cartesian_shape',
118+
optional: true,
119+
},
120+
],
121+
returnType: 'long',
122+
},
113123
{
114124
params: [
115125
{
@@ -120,6 +130,16 @@ const countDefinition: FunctionDefinition = {
120130
],
121131
returnType: 'long',
122132
},
133+
{
134+
params: [
135+
{
136+
name: 'field',
137+
type: 'date_nanos',
138+
optional: true,
139+
},
140+
],
141+
returnType: 'long',
142+
},
123143
{
124144
params: [
125145
{
@@ -140,6 +160,16 @@ const countDefinition: FunctionDefinition = {
140160
],
141161
returnType: 'long',
142162
},
163+
{
164+
params: [
165+
{
166+
name: 'field',
167+
type: 'geo_shape',
168+
optional: true,
169+
},
170+
],
171+
returnType: 'long',
172+
},
143173
{
144174
params: [
145175
{
@@ -892,6 +922,16 @@ const maxDefinition: FunctionDefinition = {
892922
],
893923
returnType: 'keyword',
894924
},
925+
{
926+
params: [
927+
{
928+
name: 'field',
929+
type: 'unsigned_long',
930+
optional: false,
931+
},
932+
],
933+
returnType: 'unsigned_long',
934+
},
895935
{
896936
params: [
897937
{
@@ -1111,6 +1151,16 @@ const minDefinition: FunctionDefinition = {
11111151
],
11121152
returnType: 'keyword',
11131153
},
1154+
{
1155+
params: [
1156+
{
1157+
name: 'field',
1158+
type: 'unsigned_long',
1159+
optional: false,
1160+
},
1161+
],
1162+
returnType: 'unsigned_long',
1163+
},
11141164
{
11151165
params: [
11161166
{
@@ -1499,6 +1549,21 @@ const sampleDefinition: FunctionDefinition = {
14991549
],
15001550
returnType: 'keyword',
15011551
},
1552+
{
1553+
params: [
1554+
{
1555+
name: 'field',
1556+
type: 'unsigned_long',
1557+
optional: false,
1558+
},
1559+
{
1560+
name: 'limit',
1561+
type: 'integer',
1562+
optional: false,
1563+
},
1564+
],
1565+
returnType: 'unsigned_long',
1566+
},
15021567
{
15031568
params: [
15041569
{
@@ -2050,6 +2115,16 @@ const valuesDefinition: FunctionDefinition = {
20502115
],
20512116
returnType: 'keyword',
20522117
},
2118+
{
2119+
params: [
2120+
{
2121+
name: 'field',
2122+
type: 'unsigned_long',
2123+
optional: false,
2124+
},
2125+
],
2126+
returnType: 'unsigned_long',
2127+
},
20532128
{
20542129
params: [
20552130
{

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ export const esqlFunctionNames = [
182182
'TOP',
183183
'TRIM',
184184
'V_COSINE',
185+
'V_DOT_PRODUCT',
186+
'V_L1_NORM',
185187
'VALUES',
186188
'WEIGHTED_AVG',
187189
'ADD',

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

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4803,7 +4803,7 @@ const md5Definition: FunctionDefinition = {
48034803
type: FunctionDefinitionTypes.SCALAR,
48044804
name: 'md5',
48054805
description: i18n.translate('kbn-esql-ast.esql.definitions.md5', {
4806-
defaultMessage: 'Computes the MD5 hash of the input.',
4806+
defaultMessage: 'Computes the MD5 hash of the input (if the MD5 hash is available on the JVM).',
48074807
}),
48084808
preview: false,
48094809
alias: undefined,
@@ -13752,6 +13752,60 @@ const vCosineDefinition: FunctionDefinition = {
1375213752
],
1375313753
};
1375413754

13755+
// Do not edit this manually... generated by scripts/generate_function_definitions.ts
13756+
const vDotProductDefinition: FunctionDefinition = {
13757+
type: FunctionDefinitionTypes.SCALAR,
13758+
name: 'v_dot_product',
13759+
description: i18n.translate('kbn-esql-ast.esql.definitions.v_dot_product', {
13760+
defaultMessage: 'Calculates the dot product between two dense_vectors.',
13761+
}),
13762+
ignoreAsSuggestion: true,
13763+
preview: true,
13764+
alias: undefined,
13765+
signatures: [],
13766+
locationsAvailable: [
13767+
Location.EVAL,
13768+
Location.ROW,
13769+
Location.SORT,
13770+
Location.WHERE,
13771+
Location.STATS,
13772+
Location.STATS_BY,
13773+
Location.STATS_WHERE,
13774+
Location.COMPLETION,
13775+
],
13776+
validate: undefined,
13777+
examples: [
13778+
' from colors\n | eval similarity = v_dot_product(rgb_vector, [0, 255, 255])\n | sort similarity desc, color asc',
13779+
],
13780+
};
13781+
13782+
// Do not edit this manually... generated by scripts/generate_function_definitions.ts
13783+
const vL1NormDefinition: FunctionDefinition = {
13784+
type: FunctionDefinitionTypes.SCALAR,
13785+
name: 'v_l1_norm',
13786+
description: i18n.translate('kbn-esql-ast.esql.definitions.v_l1_norm', {
13787+
defaultMessage: 'Calculates the l1 norm between two dense_vectors.',
13788+
}),
13789+
ignoreAsSuggestion: true,
13790+
preview: true,
13791+
alias: undefined,
13792+
signatures: [],
13793+
locationsAvailable: [
13794+
Location.EVAL,
13795+
Location.ROW,
13796+
Location.SORT,
13797+
Location.WHERE,
13798+
Location.STATS,
13799+
Location.STATS_BY,
13800+
Location.STATS_WHERE,
13801+
Location.COMPLETION,
13802+
],
13803+
validate: undefined,
13804+
examples: [
13805+
' from colors\n | eval similarity = v_l1_norm(rgb_vector, [0, 255, 255])\n | sort similarity desc, color asc',
13806+
],
13807+
};
13808+
1375513809
// Do not edit this manually... generated by scripts/generate_function_definitions.ts
1375613810
const caseDefinition: FunctionDefinition = {
1375713811
type: FunctionDefinitionTypes.SCALAR,
@@ -13924,5 +13978,7 @@ export const scalarFunctionDefinitions = [
1392413978
toVersionDefinition,
1392513979
trimDefinition,
1392613980
vCosineDefinition,
13981+
vDotProductDefinition,
13982+
vL1NormDefinition,
1392713983
caseDefinition,
1392813984
];

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

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,16 @@ const countOverTimeDefinition: FunctionDefinition = {
679679
],
680680
returnType: 'long',
681681
},
682+
{
683+
params: [
684+
{
685+
name: 'field',
686+
type: 'cartesian_shape',
687+
optional: false,
688+
},
689+
],
690+
returnType: 'long',
691+
},
682692
{
683693
params: [
684694
{
@@ -689,6 +699,16 @@ const countOverTimeDefinition: FunctionDefinition = {
689699
],
690700
returnType: 'long',
691701
},
702+
{
703+
params: [
704+
{
705+
name: 'field',
706+
type: 'date_nanos',
707+
optional: false,
708+
},
709+
],
710+
returnType: 'long',
711+
},
692712
{
693713
params: [
694714
{
@@ -709,6 +729,16 @@ const countOverTimeDefinition: FunctionDefinition = {
709729
],
710730
returnType: 'long',
711731
},
732+
{
733+
params: [
734+
{
735+
name: 'field',
736+
type: 'geo_shape',
737+
optional: false,
738+
},
739+
],
740+
returnType: 'long',
741+
},
712742
{
713743
params: [
714744
{
@@ -988,6 +1018,16 @@ const maxOverTimeDefinition: FunctionDefinition = {
9881018
],
9891019
returnType: 'keyword',
9901020
},
1021+
{
1022+
params: [
1023+
{
1024+
name: 'field',
1025+
type: 'unsigned_long',
1026+
optional: false,
1027+
},
1028+
],
1029+
returnType: 'unsigned_long',
1030+
},
9911031
{
9921032
params: [
9931033
{
@@ -1107,6 +1147,16 @@ const minOverTimeDefinition: FunctionDefinition = {
11071147
],
11081148
returnType: 'keyword',
11091149
},
1150+
{
1151+
params: [
1152+
{
1153+
name: 'field',
1154+
type: 'unsigned_long',
1155+
optional: false,
1156+
},
1157+
],
1158+
returnType: 'unsigned_long',
1159+
},
11101160
{
11111161
params: [
11121162
{

0 commit comments

Comments
 (0)