Skip to content

Commit 64179da

Browse files
kibanamachineqn895
authored andcommitted
[ES|QL] Update function metadata (elastic#232041)
This PR updates the function definitions and inline docs based on the latest metadata from Elasticsearch.
1 parent 9db87d9 commit 64179da

File tree

4 files changed

+328
-0
lines changed

4 files changed

+328
-0
lines changed

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

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1375,6 +1375,38 @@ export const functions = {
13751375
),
13761376
},
13771377
// Do not edit manually... automatically generated by scripts/generate_esql_docs.ts
1378+
{
1379+
label: i18n.translate('languageDocumentation.documentationESQL.month_name', {
1380+
defaultMessage: 'MONTH_NAME',
1381+
}),
1382+
preview: false,
1383+
license: undefined,
1384+
description: (
1385+
<Markdown
1386+
openLinksInNewTab
1387+
readOnly
1388+
enableSoftLineBreaks
1389+
markdownContent={i18n.translate(
1390+
'languageDocumentation.documentationESQL.month_name.markdown',
1391+
{
1392+
defaultMessage: `
1393+
### MONTH NAME
1394+
Returns the month name for the provided date based on the configured Locale.
1395+
1396+
\`\`\`esql
1397+
ROW dt = to_datetime("1996-03-21T00:00:00.000Z")
1398+
| EVAL monthName = MONTH_NAME(dt);
1399+
\`\`\`
1400+
`,
1401+
description:
1402+
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
1403+
ignoreTag: true,
1404+
}
1405+
)}
1406+
/>
1407+
),
1408+
},
1409+
// Do not edit manually... automatically generated by scripts/generate_esql_docs.ts
13781410
{
13791411
label: i18n.translate('languageDocumentation.documentationESQL.multi_match', {
13801412
defaultMessage: 'MULTI_MATCH',

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

Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,222 @@ const countDistinctDefinition: FunctionDefinition = {
819819
],
820820
};
821821

822+
// Do not edit this manually... generated by scripts/generate_function_definitions.ts
823+
const firstDefinition: FunctionDefinition = {
824+
type: FunctionDefinitionTypes.AGG,
825+
name: 'first',
826+
description: i18n.translate('kbn-esql-ast.esql.definitions.first', {
827+
defaultMessage: 'The earliest value of a field.',
828+
}),
829+
ignoreAsSuggestion: true,
830+
preview: false,
831+
alias: undefined,
832+
signatures: [
833+
{
834+
params: [
835+
{
836+
name: 'value',
837+
type: 'double',
838+
optional: false,
839+
},
840+
{
841+
name: 'sort',
842+
type: 'date',
843+
optional: false,
844+
},
845+
],
846+
returnType: 'double',
847+
},
848+
{
849+
params: [
850+
{
851+
name: 'value',
852+
type: 'double',
853+
optional: false,
854+
},
855+
{
856+
name: 'sort',
857+
type: 'date_nanos',
858+
optional: false,
859+
},
860+
],
861+
returnType: 'double',
862+
},
863+
{
864+
params: [
865+
{
866+
name: 'value',
867+
type: 'integer',
868+
optional: false,
869+
},
870+
{
871+
name: 'sort',
872+
type: 'date',
873+
optional: false,
874+
},
875+
],
876+
returnType: 'integer',
877+
},
878+
{
879+
params: [
880+
{
881+
name: 'value',
882+
type: 'integer',
883+
optional: false,
884+
},
885+
{
886+
name: 'sort',
887+
type: 'date_nanos',
888+
optional: false,
889+
},
890+
],
891+
returnType: 'integer',
892+
},
893+
{
894+
params: [
895+
{
896+
name: 'value',
897+
type: 'long',
898+
optional: false,
899+
},
900+
{
901+
name: 'sort',
902+
type: 'date',
903+
optional: false,
904+
},
905+
],
906+
returnType: 'long',
907+
},
908+
{
909+
params: [
910+
{
911+
name: 'value',
912+
type: 'long',
913+
optional: false,
914+
},
915+
{
916+
name: 'sort',
917+
type: 'date_nanos',
918+
optional: false,
919+
},
920+
],
921+
returnType: 'long',
922+
},
923+
],
924+
locationsAvailable: [Location.STATS],
925+
examples: [
926+
'FROM k8s\n| STATS first_bytes_in = FIRST(network.bytes_in, @timestamp) BY pod\n| SORT pod ASC',
927+
],
928+
};
929+
930+
// Do not edit this manually... generated by scripts/generate_function_definitions.ts
931+
const lastDefinition: FunctionDefinition = {
932+
type: FunctionDefinitionTypes.AGG,
933+
name: 'last',
934+
description: i18n.translate('kbn-esql-ast.esql.definitions.last', {
935+
defaultMessage: 'The latest value of a field.',
936+
}),
937+
ignoreAsSuggestion: true,
938+
preview: false,
939+
alias: undefined,
940+
signatures: [
941+
{
942+
params: [
943+
{
944+
name: 'value',
945+
type: 'double',
946+
optional: false,
947+
},
948+
{
949+
name: 'sort',
950+
type: 'date',
951+
optional: false,
952+
},
953+
],
954+
returnType: 'double',
955+
},
956+
{
957+
params: [
958+
{
959+
name: 'value',
960+
type: 'double',
961+
optional: false,
962+
},
963+
{
964+
name: 'sort',
965+
type: 'date_nanos',
966+
optional: false,
967+
},
968+
],
969+
returnType: 'double',
970+
},
971+
{
972+
params: [
973+
{
974+
name: 'value',
975+
type: 'integer',
976+
optional: false,
977+
},
978+
{
979+
name: 'sort',
980+
type: 'date',
981+
optional: false,
982+
},
983+
],
984+
returnType: 'integer',
985+
},
986+
{
987+
params: [
988+
{
989+
name: 'value',
990+
type: 'integer',
991+
optional: false,
992+
},
993+
{
994+
name: 'sort',
995+
type: 'date_nanos',
996+
optional: false,
997+
},
998+
],
999+
returnType: 'integer',
1000+
},
1001+
{
1002+
params: [
1003+
{
1004+
name: 'value',
1005+
type: 'long',
1006+
optional: false,
1007+
},
1008+
{
1009+
name: 'sort',
1010+
type: 'date',
1011+
optional: false,
1012+
},
1013+
],
1014+
returnType: 'long',
1015+
},
1016+
{
1017+
params: [
1018+
{
1019+
name: 'value',
1020+
type: 'long',
1021+
optional: false,
1022+
},
1023+
{
1024+
name: 'sort',
1025+
type: 'date_nanos',
1026+
optional: false,
1027+
},
1028+
],
1029+
returnType: 'long',
1030+
},
1031+
],
1032+
locationsAvailable: [Location.STATS],
1033+
examples: [
1034+
'FROM k8s\n| STATS last_bytes_in = LAST(network.bytes_in, @timestamp) BY pod\n| SORT pod ASC',
1035+
],
1036+
};
1037+
8221038
// Do not edit this manually... generated by scripts/generate_function_definitions.ts
8231039
const maxDefinition: FunctionDefinition = {
8241040
type: FunctionDefinitionTypes.AGG,
@@ -2283,6 +2499,8 @@ export const aggFunctionDefinitions = [
22832499
avgDefinition,
22842500
countDefinition,
22852501
countDistinctDefinition,
2502+
firstDefinition,
2503+
lastDefinition,
22862504
maxDefinition,
22872505
medianDefinition,
22882506
medianAbsoluteDeviationDefinition,

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export const esqlFunctionNames = [
6060
'E',
6161
'ENDS_WITH',
6262
'EXP',
63+
'FIRST',
6364
'FIRST_OVER_TIME',
6465
'FLOOR',
6566
'FROM_BASE64',
@@ -69,6 +70,7 @@ export const esqlFunctionNames = [
6970
'IP_PREFIX',
7071
'KNN',
7172
'KQL',
73+
'LAST',
7274
'LAST_OVER_TIME',
7375
'LEAST',
7476
'LEFT',
@@ -86,6 +88,7 @@ export const esqlFunctionNames = [
8688
'MEDIAN_ABSOLUTE_DEVIATION',
8789
'MIN',
8890
'MIN_OVER_TIME',
91+
'MONTH_NAME',
8992
'MULTI_MATCH',
9093
'MV_APPEND',
9194
'MV_AVG',
@@ -187,6 +190,7 @@ export const esqlFunctionNames = [
187190
'V_DOT_PRODUCT',
188191
'V_L1_NORM',
189192
'V_L2_NORM',
193+
'V_MAGNITUDE',
190194
'VALUES',
191195
'WEIGHTED_AVG',
192196
'ADD',

0 commit comments

Comments
 (0)