Update function metadata

This commit is contained in:
kibanamachine 2025-04-14 04:11:30 +00:00
parent 584875e666
commit 13611ade0f
7 changed files with 748 additions and 676 deletions

View file

@ -36,14 +36,12 @@ export const functions = {
readOnly
enableSoftLineBreaks
markdownContent={i18n.translate('languageDocumentation.documentationESQL.avg.markdown', {
defaultMessage: `<!--
This is generated by ESQLs AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
-->
defaultMessage: `% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
### AVG
The average of a numeric field.
\`\`\` esql
\`\`\`esql
FROM employees
| STATS AVG(height)
\`\`\`
@ -69,14 +67,12 @@ export const functions = {
markdownContent={i18n.translate(
'languageDocumentation.documentationESQL.count.markdown',
{
defaultMessage: `<!--
This is generated by ESQLs AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
-->
defaultMessage: `% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
### COUNT
Returns the total number (count) of input values.
\`\`\` esql
\`\`\`esql
FROM employees
| STATS COUNT(height)
\`\`\`
@ -103,14 +99,12 @@ export const functions = {
markdownContent={i18n.translate(
'languageDocumentation.documentationESQL.count_distinct.markdown',
{
defaultMessage: `<!--
This is generated by ESQLs AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
-->
defaultMessage: `% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
### COUNT_DISTINCT
### COUNT DISTINCT
Returns the approximate number of distinct values.
\`\`\` esql
\`\`\`esql
FROM hosts
| STATS COUNT_DISTINCT(ip0), COUNT_DISTINCT(ip1)
\`\`\`
@ -135,14 +129,12 @@ export const functions = {
readOnly
enableSoftLineBreaks
markdownContent={i18n.translate('languageDocumentation.documentationESQL.max.markdown', {
defaultMessage: `<!--
This is generated by ESQLs AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
-->
defaultMessage: `% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
### MAX
The maximum value of a field.
\`\`\` esql
\`\`\`esql
FROM employees
| STATS MAX(languages)
\`\`\`
@ -168,18 +160,16 @@ export const functions = {
markdownContent={i18n.translate(
'languageDocumentation.documentationESQL.median.markdown',
{
defaultMessage: `<!--
This is generated by ESQLs AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
-->
defaultMessage: `% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
### MEDIAN
The value that is greater than half of all values and less than half of all values, also known as the 50% \`PERCENTILE\`.
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/elasticsearch/query-languages/esql/functions-operators/aggregation-functions#esql-percentile).
\`\`\` esql
\`\`\`esql
FROM employees
| STATS MEDIAN(salary), PERCENTILE(salary, 50)
\`\`\`
Note: Like \`PERCENTILE\`, \`MEDIAN\` is usually approximate.
Note: Like [\`PERCENTILE\`](https://www.elastic.co/docs/reference/elasticsearch/query-languages/esql/functions-operators/aggregation-functions#esql-percentile), \`MEDIAN\` is [usually approximate](https://www.elastic.co/docs/reference/elasticsearch/query-languages/esql/functions-operators/aggregation-functions#esql-percentile-approximate).
`,
description:
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
@ -203,20 +193,18 @@ export const functions = {
markdownContent={i18n.translate(
'languageDocumentation.documentationESQL.median_absolute_deviation.markdown',
{
defaultMessage: `<!--
This is generated by ESQLs AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
-->
defaultMessage: `% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
### MEDIAN_ABSOLUTE_DEVIATION
### MEDIAN ABSOLUTE DEVIATION
Returns the median absolute deviation, a measure of variability. It is a robust statistic, meaning that it is useful for describing data that may have outliers, or may not be normally distributed. For such data it can be more descriptive than standard deviation.
It is calculated as the median of each data points deviation from the median of the entire sample. That is, for a random variable \`X\`, the median absolute deviation is \`median(|median(X) - X|)\`.
\`\`\` esql
\`\`\`esql
FROM employees
| STATS MEDIAN(salary), MEDIAN_ABSOLUTE_DEVIATION(salary)
\`\`\`
Note: Like \`PERCENTILE\`, \`MEDIAN_ABSOLUTE_DEVIATION\` is usually approximate.
Note: Like [\`PERCENTILE\`](https://www.elastic.co/docs/reference/elasticsearch/query-languages/esql/functions-operators/aggregation-functions#esql-percentile), \`MEDIAN_ABSOLUTE_DEVIATION\` is [usually approximate](https://www.elastic.co/docs/reference/elasticsearch/query-languages/esql/functions-operators/aggregation-functions#esql-percentile-approximate).
`,
description:
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
@ -238,14 +226,12 @@ export const functions = {
readOnly
enableSoftLineBreaks
markdownContent={i18n.translate('languageDocumentation.documentationESQL.min.markdown', {
defaultMessage: `<!--
This is generated by ESQLs AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
-->
defaultMessage: `% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
### MIN
The minimum value of a field.
\`\`\` esql
\`\`\`esql
FROM employees
| STATS MIN(languages)
\`\`\`
@ -271,14 +257,12 @@ export const functions = {
markdownContent={i18n.translate(
'languageDocumentation.documentationESQL.percentile.markdown',
{
defaultMessage: `<!--
This is generated by ESQLs AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
-->
defaultMessage: `% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
### PERCENTILE
Returns the value at which a certain percentage of observed values occur. For example, the 95th percentile is the value which is greater than 95% of the observed values and the 50th percentile is the \`MEDIAN\`.
\`\`\` esql
\`\`\`esql
FROM employees
| STATS p0 = PERCENTILE(salary, 0)
, p50 = PERCENTILE(salary, 50)
@ -307,14 +291,12 @@ export const functions = {
markdownContent={i18n.translate(
'languageDocumentation.documentationESQL.st_centroid_agg.markdown',
{
defaultMessage: `<!--
This is generated by ESQLs AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
-->
defaultMessage: `% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
### ST_CENTROID_AGG
### ST CENTROID AGG
Calculate the spatial centroid over a field with spatial point geometry type.
\`\`\` esql
\`\`\`esql
FROM airports
| STATS centroid=ST_CENTROID_AGG(location)
\`\`\`
@ -341,14 +323,12 @@ export const functions = {
markdownContent={i18n.translate(
'languageDocumentation.documentationESQL.st_extent_agg.markdown',
{
defaultMessage: `<!--
This is generated by ESQLs AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
-->
defaultMessage: `% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
### ST_EXTENT_AGG
### ST EXTENT AGG
Calculate the spatial extent over a field with geometry type. Returns a bounding box for all values of the field.
\`\`\` esql
\`\`\`esql
FROM airports
| WHERE country == "India"
| STATS extent = ST_EXTENT_AGG(location)
@ -376,14 +356,12 @@ export const functions = {
markdownContent={i18n.translate(
'languageDocumentation.documentationESQL.std_dev.markdown',
{
defaultMessage: `<!--
This is generated by ESQLs AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
-->
defaultMessage: `% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
### STD_DEV
### STD DEV
The standard deviation of a numeric field.
\`\`\` esql
\`\`\`esql
FROM employees
| STATS STD_DEV(height)
\`\`\`
@ -408,14 +386,12 @@ export const functions = {
readOnly
enableSoftLineBreaks
markdownContent={i18n.translate('languageDocumentation.documentationESQL.sum.markdown', {
defaultMessage: `<!--
This is generated by ESQLs AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
-->
defaultMessage: `% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
### SUM
The sum of a numeric expression.
\`\`\` esql
\`\`\`esql
FROM employees
| STATS SUM(languages)
\`\`\`
@ -439,14 +415,12 @@ export const functions = {
readOnly
enableSoftLineBreaks
markdownContent={i18n.translate('languageDocumentation.documentationESQL.top.markdown', {
defaultMessage: `<!--
This is generated by ESQLs AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
-->
defaultMessage: `% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
### TOP
Collects the top values for a field. Includes repeated values.
\`\`\` esql
\`\`\`esql
FROM employees
| STATS top_salaries = TOP(salary, 3, "desc"), top_salary = MAX(salary)
\`\`\`
@ -472,17 +446,15 @@ export const functions = {
markdownContent={i18n.translate(
'languageDocumentation.documentationESQL.values.markdown',
{
defaultMessage: `<!--
This is generated by ESQLs AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
-->
defaultMessage: `% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
### VALUES
Returns all values in a group as a multivalued field. The order of the returned values isnt guaranteed. If you need the values returned in order use \`MV_SORT\`.
Returns all values in a group as a multivalued field. The order of the returned values isnt guaranteed. If you need the values returned in order use [\`MV_SORT\`](https://www.elastic.co/docs/reference/elasticsearch/query-languages/esql/functions-operators/mv-functions#esql-mv_sort).
\`\`\` esql
FROM employees
\`\`\`esql
FROM employees
| EVAL first_letter = SUBSTRING(first_name, 0, 1)
| STATS first_name=MV_SORT(VALUES(first_name)) BY first_letter
| STATS first_name = MV_SORT(VALUES(first_name)) BY first_letter
| SORT first_letter
\`\`\`
`,
@ -508,16 +480,14 @@ export const functions = {
markdownContent={i18n.translate(
'languageDocumentation.documentationESQL.weighted_avg.markdown',
{
defaultMessage: `<!--
This is generated by ESQLs AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
-->
defaultMessage: `% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
### WEIGHTED_AVG
### WEIGHTED AVG
The weighted average of a numeric expression.
\`\`\` esql
\`\`\`esql
FROM employees
| STATS w_avg = WEIGHTED_AVG(salary, height) by languages
| STATS w_avg = WEIGHTED_AVG(salary, height) BY languages
| EVAL w_avg = ROUND(w_avg)
| KEEP w_avg, languages
| SORT languages

View file

@ -38,19 +38,16 @@ export const functions = {
markdownContent={i18n.translate(
'languageDocumentation.documentationESQL.bucket.markdown',
{
defaultMessage: `<!--
This is generated by ESQLs AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
-->
defaultMessage: `% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
### BUCKET
Creates groups of values - buckets - out of a datetime or numeric input.
The size of the buckets can either be provided directly, or chosen based on a recommended count and values range.
\`\`\` esql
\`\`\`esql
FROM employees
| WHERE hire_date >= "1985-01-01T00:00:00Z" AND hire_date < "1986-01-01T00:00:00Z"
| STATS hire_date = MV_SORT(VALUES(hire_date)) BY month = BUCKET(hire_date, 20, "1985-01-01T00:00:00Z", "1986-01-01T00:00:00Z")
| SORT hire_date
\`\`\`
`,
description:
@ -75,14 +72,12 @@ export const functions = {
markdownContent={i18n.translate(
'languageDocumentation.documentationESQL.categorize.markdown',
{
defaultMessage: `<!--
This is generated by ESQLs AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
-->
defaultMessage: `% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
### CATEGORIZE
Groups text messages into categories of similarly formatted text values.
\`\`\` esql
\`\`\`esql
FROM sample_data
| STATS count=COUNT() BY category=CATEGORIZE(message)
\`\`\`

View file

@ -1689,7 +1689,7 @@ const valuesDefinition: FunctionDefinition = {
name: 'values',
description: i18n.translate('kbn-esql-validation-autocomplete.esql.definitions.values', {
defaultMessage:
'Returns all values in a group as a multivalued field. The order of the returned values isnt guaranteed. If you need the values returned in order use esql-mv_sort.',
'Returns all values in a group as a multivalued field. The order of the returned values isnt guaranteed. If you need the values returned in order use `MV_SORT`.',
}),
preview: true,
alias: undefined,

View file

@ -824,16 +824,16 @@ const bucketDefinition: FunctionDefinition = {
locationsAvailable: [Location.STATS, Location.STATS_BY],
validate: undefined,
examples: [
'FROM employees\n| WHERE hire_date >= "1985-01-01T00:00:00Z" AND hire_date < "1986-01-01T00:00:00Z"\n| STATS hire_date = MV_SORT(VALUES(hire_date)) BY month = BUCKET(hire_date, 20, "1985-01-01T00:00:00Z", "1986-01-01T00:00:00Z")\n| SORT hire_date',
'FROM employees\n| WHERE hire_date >= "1985-01-01T00:00:00Z" AND hire_date < "1986-01-01T00:00:00Z"\n| STATS hire_date = MV_SORT(VALUES(hire_date)) BY month = BUCKET(hire_date, 20, "1985-01-01T00:00:00Z", "1986-01-01T00:00:00Z")',
'FROM employees\n| WHERE hire_date >= "1985-01-01T00:00:00Z" AND hire_date < "1986-01-01T00:00:00Z"\n| STATS hires_per_month = COUNT(*) BY month = BUCKET(hire_date, 20, "1985-01-01T00:00:00Z", "1986-01-01T00:00:00Z")\n| SORT month',
'FROM employees\n| WHERE hire_date >= "1985-01-01T00:00:00Z" AND hire_date < "1986-01-01T00:00:00Z"\n| STATS hires_per_week = COUNT(*) BY week = BUCKET(hire_date, 100, "1985-01-01T00:00:00Z", "1986-01-01T00:00:00Z")\n| SORT week',
'FROM employees\n| WHERE hire_date >= "1985-01-01T00:00:00Z" AND hire_date < "1986-01-01T00:00:00Z"\n| STATS hires_per_week = COUNT(*) BY week = BUCKET(hire_date, 100, "1985-01-01T00:00:00Z", "1986-01-01T00:00:00Z")',
'FROM employees\n| WHERE hire_date >= "1985-01-01T00:00:00Z" AND hire_date < "1986-01-01T00:00:00Z"\n| STATS hires_per_week = COUNT(*) BY week = BUCKET(hire_date, 1 week)\n| SORT week',
'FROM employees\n| STATS COUNT(*) by bs = BUCKET(salary, 20, 25324, 74999)\n| SORT bs',
'FROM employees\n| WHERE hire_date >= "1985-01-01T00:00:00Z" AND hire_date < "1986-01-01T00:00:00Z"\n| STATS c = COUNT(1) BY b = BUCKET(salary, 5000.)\n| SORT b',
'FROM sample_data\n| WHERE @timestamp >= NOW() - 1 day and @timestamp < NOW()\n| STATS COUNT(*) BY bucket = BUCKET(@timestamp, 25, NOW() - 1 day, NOW())',
'FROM employees\n| WHERE hire_date >= "1985-01-01T00:00:00Z" AND hire_date < "1986-01-01T00:00:00Z"\n| STATS AVG(salary) BY bucket = BUCKET(hire_date, 20, "1985-01-01T00:00:00Z", "1986-01-01T00:00:00Z")\n| SORT bucket',
'FROM employees\n| WHERE hire_date >= "1985-01-01T00:00:00Z" AND hire_date < "1986-01-01T00:00:00Z"\n| STATS AVG(salary) BY bucket = BUCKET(hire_date, 20, "1985-01-01T00:00:00Z", "1986-01-01T00:00:00Z")',
'FROM employees\n| STATS s1 = b1 + 1, s2 = BUCKET(salary / 1000 + 999, 50.) + 2 BY b1 = BUCKET(salary / 100 + 99, 50.), b2 = BUCKET(salary / 1000 + 999, 50.)\n| SORT b1, b2\n| KEEP s1, b1, s2, b2',
'FROM employees\n| STATS dates = MV_SORT(VALUES(birth_date)) BY b = BUCKET(birth_date + 1 HOUR, 1 YEAR) - 1 HOUR\n| EVAL d_count = MV_COUNT(dates)\n| SORT d_count, b\n| LIMIT 3',
'FROM employees\n| STATS dates = MV_SORT(VALUES(birth_date)) BY b = BUCKET(birth_date + 1 HOUR, 1 YEAR) - 1 HOUR\n| EVAL d_count = MV_COUNT(dates)',
],
};

View file

@ -2091,6 +2091,338 @@ const inDefinition: FunctionDefinition = {
examples: ['ROW a = 1, b = 4, c = 3\n| WHERE c-a IN (3, b / 2, a)'],
};
// Do not edit this manually... generated by scripts/generate_function_definitions.ts
const isNotNullDefinition: FunctionDefinition = {
type: FunctionDefinitionTypes.OPERATOR,
name: 'is_not_null',
description: i18n.translate('kbn-esql-validation-autocomplete.esql.definitions.is_not_null', {
defaultMessage: 'Use `IS NOT NULL` to filter data based on whether the field exists or not.',
}),
preview: false,
alias: undefined,
signatures: [
{
params: [
{
name: 'left',
type: 'boolean',
optional: false,
},
],
returnType: 'boolean',
},
{
params: [
{
name: 'left',
type: 'cartesian_point',
optional: false,
},
],
returnType: 'boolean',
},
{
params: [
{
name: 'left',
type: 'cartesian_shape',
optional: false,
},
],
returnType: 'boolean',
},
{
params: [
{
name: 'left',
type: 'date',
optional: false,
},
],
returnType: 'boolean',
},
{
params: [
{
name: 'left',
type: 'date_nanos',
optional: false,
},
],
returnType: 'boolean',
},
{
params: [
{
name: 'left',
type: 'double',
optional: false,
},
],
returnType: 'boolean',
},
{
params: [
{
name: 'left',
type: 'geo_point',
optional: false,
},
],
returnType: 'boolean',
},
{
params: [
{
name: 'left',
type: 'geo_shape',
optional: false,
},
],
returnType: 'boolean',
},
{
params: [
{
name: 'left',
type: 'integer',
optional: false,
},
],
returnType: 'boolean',
},
{
params: [
{
name: 'left',
type: 'ip',
optional: false,
},
],
returnType: 'boolean',
},
{
params: [
{
name: 'left',
type: 'keyword',
optional: false,
},
],
returnType: 'boolean',
},
{
params: [
{
name: 'left',
type: 'long',
optional: false,
},
],
returnType: 'boolean',
},
{
params: [
{
name: 'left',
type: 'text',
optional: false,
},
],
returnType: 'boolean',
},
{
params: [
{
name: 'left',
type: 'unsigned_long',
optional: false,
},
],
returnType: 'boolean',
},
{
params: [
{
name: 'left',
type: 'version',
optional: false,
},
],
returnType: 'boolean',
},
],
locationsAvailable: [Location.STATS],
validate: undefined,
examples: ['FROM employees\n| WHERE is_rehired IS NOT NULL\n| STATS COUNT(emp_no)'],
};
// Do not edit this manually... generated by scripts/generate_function_definitions.ts
const isNullDefinition: FunctionDefinition = {
type: FunctionDefinitionTypes.OPERATOR,
name: 'is null',
description: i18n.translate('kbn-esql-validation-autocomplete.esql.definitions.is_null', {
defaultMessage: 'Use `IS NULL` to filter data based on whether the field exists or not.',
}),
preview: false,
alias: undefined,
signatures: [
{
params: [
{
name: 'left',
type: 'boolean',
optional: false,
},
],
returnType: 'boolean',
},
{
params: [
{
name: 'left',
type: 'cartesian_point',
optional: false,
},
],
returnType: 'boolean',
},
{
params: [
{
name: 'left',
type: 'cartesian_shape',
optional: false,
},
],
returnType: 'boolean',
},
{
params: [
{
name: 'left',
type: 'date',
optional: false,
},
],
returnType: 'boolean',
},
{
params: [
{
name: 'left',
type: 'date_nanos',
optional: false,
},
],
returnType: 'boolean',
},
{
params: [
{
name: 'left',
type: 'double',
optional: false,
},
],
returnType: 'boolean',
},
{
params: [
{
name: 'left',
type: 'geo_point',
optional: false,
},
],
returnType: 'boolean',
},
{
params: [
{
name: 'left',
type: 'geo_shape',
optional: false,
},
],
returnType: 'boolean',
},
{
params: [
{
name: 'left',
type: 'integer',
optional: false,
},
],
returnType: 'boolean',
},
{
params: [
{
name: 'left',
type: 'ip',
optional: false,
},
],
returnType: 'boolean',
},
{
params: [
{
name: 'left',
type: 'keyword',
optional: false,
},
],
returnType: 'boolean',
},
{
params: [
{
name: 'left',
type: 'long',
optional: false,
},
],
returnType: 'boolean',
},
{
params: [
{
name: 'left',
type: 'text',
optional: false,
},
],
returnType: 'boolean',
},
{
params: [
{
name: 'left',
type: 'unsigned_long',
optional: false,
},
],
returnType: 'boolean',
},
{
params: [
{
name: 'left',
type: 'version',
optional: false,
},
],
returnType: 'boolean',
},
],
locationsAvailable: [Location.STATS],
validate: undefined,
examples: ['FROM employees\n| WHERE birth_date IS NULL'],
};
// Do not edit this manually... generated by scripts/generate_function_definitions.ts
const lessThanDefinition: FunctionDefinition = {
type: FunctionDefinitionTypes.OPERATOR,
@ -3394,9 +3726,7 @@ const matchOperatorDefinition: FunctionDefinition = {
],
locationsAvailable: [Location.WHERE],
validate: undefined,
examples: [
'FROM books\n| WHERE MATCH(author, "Faulkner")\n| KEEP book_no, author\n| SORT book_no\n| LIMIT 5',
],
examples: ['FROM books\n| WHERE author:"Faulkner"'],
};
// Do not edit this manually... generated by scripts/generate_function_definitions.ts
@ -4867,7 +5197,7 @@ const isNullDefinition: FunctionDefinition = {
],
validate: undefined,
examples: [
'FROM employees\n| WHERE birth_date IS NULL\n| KEEP first_name, last_name\n| SORT first_name\n| LIMIT 3',
'FROM employees\n| WHERE birth_date IS NULL',
'FROM employees\n| WHERE is_rehired IS NOT NULL\n| STATS COUNT(emp_no)',
],
};
@ -5042,7 +5372,7 @@ const isNotNullDefinition: FunctionDefinition = {
],
validate: undefined,
examples: [
'FROM employees\n| WHERE birth_date IS NULL\n| KEEP first_name, last_name\n| SORT first_name\n| LIMIT 3',
'FROM employees\n| WHERE birth_date IS NULL',
'FROM employees\n| WHERE is_rehired IS NOT NULL\n| STATS COUNT(emp_no)',
],
};
@ -5463,6 +5793,8 @@ export const operatorFunctionDefinitions = [
greaterThanDefinition,
greaterThanOrEqualDefinition,
inDefinition,
isNotNullDefinition,
isNullDefinition,
lessThanDefinition,
lessThanOrEqualDefinition,
likeDefinition,

View file

@ -1907,7 +1907,8 @@ const dateTruncDefinition: FunctionDefinition = {
type: FunctionDefinitionTypes.SCALAR,
name: 'date_trunc',
description: i18n.translate('kbn-esql-validation-autocomplete.esql.definitions.date_trunc', {
defaultMessage: 'Rounds down a date to the closest interval.',
defaultMessage:
'Rounds down a date to the closest interval since epoch, which starts at `0001-01-01T00:00:00Z`.',
}),
preview: false,
alias: undefined,
@ -2949,9 +2950,7 @@ const kqlDefinition: FunctionDefinition = {
],
locationsAvailable: [Location.WHERE],
validate: undefined,
examples: [
'FROM books\n| WHERE KQL("author: Faulkner")\n| KEEP book_no, author\n| SORT book_no\n| LIMIT 5',
],
examples: ['FROM books\n| WHERE KQL("author: Faulkner")'],
customParametersSnippet: '"""$0"""',
};
@ -3247,9 +3246,7 @@ const leftDefinition: FunctionDefinition = {
Location.STATS_WHERE,
],
validate: undefined,
examples: [
'FROM employees\n| KEEP last_name\n| EVAL left = LEFT(last_name, 3)\n| SORT last_name ASC\n| LIMIT 5',
],
examples: ['FROM employees\n| KEEP last_name\n| EVAL left = LEFT(last_name, 3)'],
};
// Do not edit this manually... generated by scripts/generate_function_definitions.ts
@ -3934,7 +3931,7 @@ const matchDefinition: FunctionDefinition = {
name: 'match',
description: i18n.translate('kbn-esql-validation-autocomplete.esql.definitions.match', {
defaultMessage:
'Use `MATCH` to perform a match query on the specified field.\nUsing `MATCH` is equivalent to using the `match` query in the Elasticsearch Query DSL.\n\nMatch can be used on fields from the text family like text and semantic_text,\nas well as other field types like keyword, boolean, dates, and numeric types.\n\nMatch can use function named parameters to specify additional options for the match query.\nAll match query parameters are supported.\n\nFor a simplified syntax, you can use the match operator `:` operator instead of `MATCH`.\n\n`MATCH` returns true if the provided query matches the row.',
'Use `MATCH` to perform a match query on the specified field.\nUsing `MATCH` is equivalent to using the `match` query in the Elasticsearch Query DSL.\n\nMatch can be used on fields from the text family like text and semantic_text,\nas well as other field types like keyword, boolean, dates, and numeric types.\n\nMatch can use function named parameters to specify additional options for the match query.\nAll match query parameters are supported.\n\nFor a simplified syntax, you can use the match operator `:` operator instead of `MATCH`.\n\n`MATCH` returns true if the provided query matches the row.',
}),
preview: true,
alias: undefined,
@ -4668,7 +4665,7 @@ const matchDefinition: FunctionDefinition = {
locationsAvailable: [Location.WHERE],
validate: undefined,
examples: [
'FROM books\n| WHERE MATCH(author, "Faulkner")\n| KEEP book_no, author\n| SORT book_no\n| LIMIT 5',
'FROM books\n| WHERE MATCH(author, "Faulkner")',
'FROM books\n| WHERE MATCH(title, "Hobbit Back Again", {"operator": "AND"})\n| KEEP title;',
],
};
@ -7673,8 +7670,8 @@ const qstrDefinition: FunctionDefinition = {
locationsAvailable: [Location.WHERE],
validate: undefined,
examples: [
'FROM books\n| WHERE QSTR("author: Faulkner")\n| KEEP book_no, author\n| SORT book_no\n| LIMIT 5',
'FROM books\n| WHERE QSTR("title: Hobbjt~", {"fuzziness": 2})\n| KEEP book_no, title\n| SORT book_no\n| LIMIT 5',
'FROM books\n| WHERE QSTR("author: Faulkner")',
'FROM books\n| WHERE QSTR("title: Hobbjt~", {"fuzziness": 2})',
],
customParametersSnippet: '"""$0"""',
};
@ -8018,9 +8015,7 @@ const rightDefinition: FunctionDefinition = {
Location.STATS_WHERE,
],
validate: undefined,
examples: [
'FROM employees\n| KEEP last_name\n| EVAL right = RIGHT(last_name, 3)\n| SORT last_name ASC\n| LIMIT 5',
],
examples: ['FROM employees\n| KEEP last_name\n| EVAL right = RIGHT(last_name, 3)'],
};
// Do not edit this manually... generated by scripts/generate_function_definitions.ts
@ -8730,7 +8725,7 @@ const stContainsDefinition: FunctionDefinition = {
name: 'st_contains',
description: i18n.translate('kbn-esql-validation-autocomplete.esql.definitions.st_contains', {
defaultMessage:
'Returns whether the first geometry contains the second geometry.\nThis is the inverse of the `ST_WITHIN` function.',
'Returns whether the first geometry contains the second geometry.\nThis is the inverse of the ST_WITHIN function.',
}),
preview: false,
alias: undefined,
@ -8877,7 +8872,7 @@ const stDisjointDefinition: FunctionDefinition = {
name: 'st_disjoint',
description: i18n.translate('kbn-esql-validation-autocomplete.esql.definitions.st_disjoint', {
defaultMessage:
'Returns whether the two geometries or geometry columns are disjoint.\nThis is the inverse of the `ST_INTERSECTS` function.\nIn mathematical terms: ST_Disjoint(A, B) ⇔ A ⋂ B = ∅',
'Returns whether the two geometries or geometry columns are disjoint.\nThis is the inverse of the ST_INTERSECTS function.\nIn mathematical terms: ST_Disjoint(A, B) ⇔ A ⋂ B = ∅',
}),
preview: false,
alias: undefined,
@ -9147,7 +9142,7 @@ const stIntersectsDefinition: FunctionDefinition = {
name: 'st_intersects',
description: i18n.translate('kbn-esql-validation-autocomplete.esql.definitions.st_intersects', {
defaultMessage:
'Returns true if two geometries intersect.\nThey intersect if they have any point in common, including their interior points\n(points along lines or within polygons).\nThis is the inverse of the `ST_DISJOINT` function.\nIn mathematical terms: ST_Intersects(A, B) ⇔ A ⋂ B ≠ ∅',
'Returns true if two geometries intersect.\nThey intersect if they have any point in common, including their interior points\n(points along lines or within polygons).\nThis is the inverse of the ST_DISJOINT function.\nIn mathematical terms: ST_Intersects(A, B) ⇔ A ⋂ B ≠ ∅',
}),
preview: false,
alias: undefined,
@ -9294,7 +9289,7 @@ const stWithinDefinition: FunctionDefinition = {
name: 'st_within',
description: i18n.translate('kbn-esql-validation-autocomplete.esql.definitions.st_within', {
defaultMessage:
'Returns whether the first geometry is within the second geometry.\nThis is the inverse of the `ST_CONTAINS` function.',
'Returns whether the first geometry is within the second geometry.\nThis is the inverse of the ST_CONTAINS function.',
}),
preview: false,
alias: undefined,
@ -10084,8 +10079,7 @@ const tauDefinition: FunctionDefinition = {
type: FunctionDefinitionTypes.SCALAR,
name: 'tau',
description: i18n.translate('kbn-esql-validation-autocomplete.esql.definitions.tau', {
defaultMessage:
'Returns the [ratio](https://tauday.com/tau-manifesto) of a circles circumference to its radius.',
defaultMessage: 'Returns the ratio of a circles circumference to its radius.',
}),
preview: false,
alias: undefined,
@ -10191,7 +10185,7 @@ const termDefinition: FunctionDefinition = {
Location.STATS_WHERE,
],
validate: undefined,
examples: ['FROM books\n| WHERE TERM(author, "gabriel")\n| KEEP book_no, title\n| LIMIT 3'],
examples: ['FROM books\n| WHERE TERM(author, "gabriel")'],
};
// Do not edit this manually... generated by scripts/generate_function_definitions.ts
@ -10368,7 +10362,7 @@ const toCartesianpointDefinition: FunctionDefinition = {
'kbn-esql-validation-autocomplete.esql.definitions.to_cartesianpoint',
{
defaultMessage:
'Converts an input value to a `cartesian_point` value.\nA string will only be successfully converted if it respects WKT Point format.',
'Converts an input value to a `cartesian_point` value.\nA string will only be successfully converted if it respects the\nWKT Point format.',
}
),
preview: false,
@ -10428,7 +10422,7 @@ const toCartesianshapeDefinition: FunctionDefinition = {
'kbn-esql-validation-autocomplete.esql.definitions.to_cartesianshape',
{
defaultMessage:
'Converts an input value to a `cartesian_shape` value.\nA string will only be successfully converted if it respects WKT format.',
'Converts an input value to a `cartesian_shape` value.\nA string will only be successfully converted if it respects the\nWKT format.',
}
),
preview: false,
@ -10957,7 +10951,7 @@ const toGeopointDefinition: FunctionDefinition = {
name: 'to_geopoint',
description: i18n.translate('kbn-esql-validation-autocomplete.esql.definitions.to_geopoint', {
defaultMessage:
'Converts an input value to a `geo_point` value.\nA string will only be successfully converted if it respects WKT Point format.',
'Converts an input value to a `geo_point` value.\nA string will only be successfully converted if it respects the\nWKT Point format.',
}),
preview: false,
alias: undefined,
@ -11012,7 +11006,7 @@ const toGeoshapeDefinition: FunctionDefinition = {
name: 'to_geoshape',
description: i18n.translate('kbn-esql-validation-autocomplete.esql.definitions.to_geoshape', {
defaultMessage:
'Converts an input value to a `geo_shape` value.\nA string will only be successfully converted if it respects WKT format.',
'Converts an input value to a `geo_shape` value.\nA string will only be successfully converted if it respects the\nWKT format.',
}),
preview: false,
alias: undefined,
@ -11241,6 +11235,8 @@ const toIpDefinition: FunctionDefinition = {
validate: undefined,
examples: [
'ROW str1 = "1.1.1.1", str2 = "foo"\n| EVAL ip1 = TO_IP(str1), ip2 = TO_IP(str2)\n| WHERE CIDR_MATCH(ip1, "1.0.0.0/8")',
'ROW s = "1.1.010.1" | EVAL ip = TO_IP(s, {"leading_zeros":"octal"})',
'ROW s = "1.1.010.1" | EVAL ip = TO_IP(s, {"leading_zeros":"decimal"})',
],
};