You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/platform/packages/private/kbn-language-documentation/src/sections/generated/aggregation_functions.tsx
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -160,11 +160,12 @@ export const functions = {
160
160
### MEDIAN
161
161
The value that is greater than half of all values and less than half of all values, also known as the 50% [\`PERCENTILE\`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/aggregation-functions#esql-percentile).
162
162
163
+
Note: Like [\`PERCENTILE\`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/aggregation-functions#esql-percentile), \`MEDIAN\` is [usually approximate](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/aggregation-functions#esql-percentile-approximate).
164
+
163
165
\`\`\`esql
164
166
FROM employees
165
167
| STATS MEDIAN(salary), PERCENTILE(salary, 50)
166
168
\`\`\`
167
-
Note: Like [\`PERCENTILE\`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/aggregation-functions#esql-percentile), \`MEDIAN\` is [usually approximate](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/aggregation-functions#esql-percentile-approximate).
168
169
`,
169
170
description:
170
171
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
@@ -194,11 +195,12 @@ export const functions = {
194
195
195
196
It is calculated as the median of each data point’s deviation from the median of the entire sample. That is, for a random variable \`X\`, the median absolute deviation is \`median(|median(X) - X|)\`.
196
197
198
+
Note: Like [\`PERCENTILE\`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/aggregation-functions#esql-percentile), \`MEDIAN_ABSOLUTE_DEVIATION\` is [usually approximate](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/aggregation-functions#esql-percentile-approximate).
Note: Like [\`PERCENTILE\`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/aggregation-functions#esql-percentile), \`MEDIAN_ABSOLUTE_DEVIATION\` is [usually approximate](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/aggregation-functions#esql-percentile-approximate).
202
204
`,
203
205
description:
204
206
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
Copy file name to clipboardExpand all lines: src/platform/packages/private/kbn-language-documentation/src/sections/generated/operators.tsx
+12-7Lines changed: 12 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,6 @@ export const functions = {
38
38
defaultMessage: `
39
39
### ADD \`+\`
40
40
Add two numbers together. If either field is [multivalued](https://www.elastic.co/docs/reference/query-languages/esql/esql-multivalued-fields) then the result is \`null\`.
41
-
42
41
`,
43
42
description:
44
43
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
@@ -240,6 +239,12 @@ export const functions = {
240
239
Returns \`false\` if the value is \`NULL\`, \`true\` otherwise.
241
240
242
241
Note: If a field is only in some documents it will be \`NULL\` in the documents that did not contain it.
242
+
243
+
\`\`\`esql
244
+
FROM employees
245
+
| WHERE is_rehired IS NOT NULL
246
+
| STATS COUNT(emp_no)
247
+
\`\`\`
243
248
`,
244
249
description:
245
250
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
@@ -268,6 +273,11 @@ export const functions = {
268
273
Returns \`true\` if the value is \`NULL\`, \`false\` otherwise.
269
274
270
275
Note: If a field is only in some documents it will be \`NULL\` in the documents that did not contain it.
276
+
277
+
\`\`\`esql
278
+
FROM employees
279
+
| WHERE birth_date IS NULL
280
+
\`\`\`
271
281
`,
272
282
description:
273
283
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
@@ -352,8 +362,7 @@ export const functions = {
352
362
Use \`LIKE\` to filter data based on string patterns using wildcards. \`LIKE\`
353
363
usually acts on a field placed on the left-hand side of the operator, but it can
354
364
also act on a constant (literal) expression. The right-hand side of the operator
355
-
represents the pattern or a list of patterns. If a list of patterns is provided,
356
-
the expression will return true if any of the patterns match.
365
+
represents the pattern.
357
366
358
367
The following wildcard characters are supported:
359
368
@@ -430,7 +439,6 @@ export const functions = {
430
439
defaultMessage: `
431
440
### MODULO \`%\`
432
441
Divide one number by another and return the remainder. If either field is [multivalued](https://www.elastic.co/docs/reference/query-languages/esql/esql-multivalued-fields) then the result is \`null\`.
433
-
434
442
`,
435
443
description:
436
444
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
@@ -457,7 +465,6 @@ export const functions = {
457
465
defaultMessage: `
458
466
### MULTIPLY \`*\`
459
467
Multiply two numbers together. If either field is [multivalued](https://www.elastic.co/docs/reference/query-languages/esql/esql-multivalued-fields) then the result is \`null\`.
460
-
461
468
`,
462
469
description:
463
470
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
@@ -484,7 +491,6 @@ export const functions = {
484
491
defaultMessage: `
485
492
### NEGATE \`-\`
486
493
Returns the negation of the argument.
487
-
488
494
`,
489
495
description:
490
496
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
@@ -574,7 +580,6 @@ export const functions = {
574
580
defaultMessage: `
575
581
### SUBTRACT \`-\`
576
582
Subtract one number from another. If either field is [multivalued](https://www.elastic.co/docs/reference/query-languages/esql/esql-multivalued-fields) then the result is \`null\`.
577
-
578
583
`,
579
584
description:
580
585
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
Note: All strings are in UTF-8, so a single character can use multiple bytes.
231
233
`,
232
234
description:
233
235
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
@@ -319,11 +321,12 @@ export const functions = {
319
321
### CEIL
320
322
Round a number up to the nearest integer.
321
323
324
+
Note: This is a noop for \`long\` (including unsigned) and \`integer\`. For \`double\` this picks the closest \`double\` value to the integer similar to [Math.ceil](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Math.html#ceil(double)).
325
+
322
326
\`\`\`esql
323
327
ROW a=1.8
324
328
| EVAL a=CEIL(a)
325
329
\`\`\`
326
-
Note: This is a noop for \`long\` (including unsigned) and \`integer\`. For \`double\` this picks the closest \`double\` value to the integer similar to [Math.ceil](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Math.html#ceil(double)).
327
330
`,
328
331
description:
329
332
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
@@ -747,13 +750,14 @@ export const functions = {
747
750
### FLOOR
748
751
Round a number down to the nearest integer.
749
752
753
+
Note: This is a noop for \`long\` (including unsigned) and \`integer\`.
754
+
For \`double\` this picks the closest \`double\` value to the integer
755
+
similar to [Math.floor](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Math.html#floor(double)).
756
+
750
757
\`\`\`esql
751
758
ROW a=1.8
752
759
| EVAL a=FLOOR(a)
753
760
\`\`\`
754
-
Note: This is a noop for \`long\` (including unsigned) and \`integer\`.
755
-
For \`double\` this picks the closest \`double\` value to the integer
756
-
similar to [Math.floor](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Math.html#floor(double)).
757
761
`,
758
762
description:
759
763
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
@@ -813,11 +817,12 @@ export const functions = {
813
817
Returns the maximum value from multiple columns. This is similar to [\`MV_MAX\`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/mv-functions#esql-mv_max)
814
818
except it is intended to run on multiple columns at once.
815
819
820
+
Note: When run on \`keyword\` or \`text\` fields, this returns the last string in alphabetical order. When run on \`boolean\` columns this will return \`true\` if any values are \`true\`.
821
+
816
822
\`\`\`esql
817
823
ROW a = 10, b = 20
818
824
| EVAL g = GREATEST(a, b)
819
825
\`\`\`
820
-
Note: When run on \`keyword\` or \`text\` fields, this returns the last string in alphabetical order. When run on \`boolean\` columns this will return \`true\` if any values are \`true\`.
821
826
`,
822
827
description:
823
828
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
It is calculated as the median of each data point’s deviation from the median of the entire sample. That is, for a random variable \`X\`, the median absolute deviation is \`median(|median(X) - X|)\`.
1614
1621
1622
+
Note: If the field has an even number of values, the medians will be calculated as the average of the middle two values. If the value is not a floating point number, the averages are rounded towards 0.
1623
+
1615
1624
\`\`\`esql
1616
1625
ROW values = [0, 2, 5, 6]
1617
1626
| EVAL median_absolute_deviation = MV_MEDIAN_ABSOLUTE_DEVIATION(values), median = MV_MEDIAN(values)
1618
1627
\`\`\`
1619
-
Note: If the field has an even number of values, the medians will be calculated as the average of the middle two values. If the value is not a floating point number, the averages are rounded towards 0.
1620
1628
`,
1621
1629
description:
1622
1630
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
Converts an input to a nanosecond-resolution date value (aka date_nanos).
3200
3209
3210
+
Note: The range for date nanos is 1970-01-01T00:00:00.000000000Z to 2262-04-11T23:47:16.854775807Z, attempting to convert values outside of that range will result in null with a warning. Additionally, integers cannot be converted into date nanos, as the range of integer nanoseconds only covers about 2 seconds after epoch.
3211
+
3201
3212
\`\`\`esql
3202
3213
FROM date_nanos
3203
3214
| WHERE MV_MIN(nanos) < TO_DATE_NANOS("2023-10-23T12:27:28.948Z")
3204
3215
AND millis > "2000-01-01"
3205
3216
| SORT nanos DESC
3206
3217
\`\`\`
3207
-
Note: The range for date nanos is 1970-01-01T00:00:00.000000000Z to 2262-04-11T23:47:16.854775807Z, attempting to convert values outside of that range will result in null with a warning. Additionally, integers cannot be converted into date nanos, as the range of integer nanoseconds only covers about 2 seconds after epoch.
3208
3218
`,
3209
3219
description:
3210
3220
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
A string will only be successfully converted if it’s respecting the format \`yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\`.
3266
3276
To convert dates in other formats, use [\`DATE_PARSE\`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/date-time-functions#esql-date_parse).
3267
3277
3278
+
Note: Note that when converting from nanosecond resolution to millisecond resolution with this function, the nanosecond date is truncated, not rounded.
Note: Note that when converting from nanosecond resolution to millisecond resolution with this function, the nanosecond date is truncated, not rounded.
3273
3284
`,
3274
3285
description:
3275
3286
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
'Use `LIKE` to filter data based on string patterns using wildcards. `LIKE`\nusually acts on a field placed on the left-hand side of the operator, but it can\nalso act on a constant (literal) expression. The right-hand side of the operator\nrepresents the pattern or a list of patterns. If a list of patterns is provided,\nthe expression will return true if any of the patterns match.\n\nThe following wildcard characters are supported:\n\n* `*` matches zero or more characters.\n* `?` matches one character.',
3238
+
'Use `LIKE` to filter data based on string patterns using wildcards. `LIKE`\nusually acts on a field placed on the left-hand side of the operator, but it can\nalso act on a constant (literal) expression. The right-hand side of the operator\nrepresents the pattern.\n\nThe following wildcard characters are supported:\n\n* `*` matches zero or more characters.\n* `?` matches one character.',
'Use `LIKE` to filter data based on string patterns using wildcards. `LIKE`\nusually acts on a field placed on the left-hand side of the operator, but it can\nalso act on a constant (literal) expression. The right-hand side of the operator\nrepresents the pattern or a list of patterns. If a list of patterns is provided,\nthe expression will return true if any of the patterns match.\n\nThe following wildcard characters are supported:\n\n* `*` matches zero or more characters.\n* `?` matches one character.',
4495
+
'Use `LIKE` to filter data based on string patterns using wildcards. `LIKE`\nusually acts on a field placed on the left-hand side of the operator, but it can\nalso act on a constant (literal) expression. The right-hand side of the operator\nrepresents the pattern.\n\nThe following wildcard characters are supported:\n\n* `*` matches zero or more characters.\n* `?` matches one character.',
Copy file name to clipboardExpand all lines: src/platform/packages/shared/kbn-esql-validation-autocomplete/src/definitions/generated/scalar_functions.ts
0 commit comments