diff --git a/src/platform/packages/shared/kbn-esql-ast/src/definitions/generated/aggregation_functions.ts b/src/platform/packages/shared/kbn-esql-ast/src/definitions/generated/aggregation_functions.ts index 7cb079da6f769..58cf3cc685e01 100644 --- a/src/platform/packages/shared/kbn-esql-ast/src/definitions/generated/aggregation_functions.ts +++ b/src/platform/packages/shared/kbn-esql-ast/src/definitions/generated/aggregation_functions.ts @@ -30,6 +30,206 @@ import { i18n } from '@kbn/i18n'; import { Location } from '../../commands_registry/types'; import { type FunctionDefinition, FunctionDefinitionTypes } from '../types'; +// Do not edit this manually... generated by scripts/generate_function_definitions.ts +const absentDefinition: FunctionDefinition = { + type: FunctionDefinitionTypes.AGG, + name: 'absent', + description: i18n.translate('kbn-esql-ast.esql.definitions.absent', { + defaultMessage: + 'Returns true if the input expression yields no non-null values within the current aggregation context. Otherwise it returns false.', + }), + preview: false, + alias: undefined, + signatures: [ + { + params: [ + { + name: 'field', + type: 'boolean', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'cartesian_point', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'cartesian_shape', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'date', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'date_nanos', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'double', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'geo_point', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'geo_shape', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'geohash', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'geohex', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'geotile', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'integer', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'ip', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'keyword', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'long', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'text', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'unsigned_long', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'version', + optional: false, + }, + ], + returnType: 'boolean', + }, + ], + locationsAvailable: [Location.STATS], + examples: [ + 'FROM employees\n| WHERE emp_no == 10020\n| STATS is_absent = ABSENT(languages)', + 'FROM employees\n| STATS is_absent = ABSENT(salary) BY languages', + 'FROM employees\n| WHERE emp_no == 10020\n| STATS is_absent = TO_INTEGER(ABSENT(languages))', + ], +}; + // Do not edit this manually... generated by scripts/generate_function_definitions.ts const avgDefinition: FunctionDefinition = { type: FunctionDefinitionTypes.AGG, @@ -1702,6 +1902,206 @@ const percentileDefinition: FunctionDefinition = { ], }; +// Do not edit this manually... generated by scripts/generate_function_definitions.ts +const presentDefinition: FunctionDefinition = { + type: FunctionDefinitionTypes.AGG, + name: 'present', + description: i18n.translate('kbn-esql-ast.esql.definitions.present', { + defaultMessage: + 'Returns true if the input expression yields any non-null values within the current aggregation context. Otherwise it returns false.', + }), + preview: false, + alias: undefined, + signatures: [ + { + params: [ + { + name: 'field', + type: 'boolean', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'cartesian_point', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'cartesian_shape', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'date', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'date_nanos', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'double', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'geo_point', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'geo_shape', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'geohash', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'geohex', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'geotile', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'integer', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'ip', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'keyword', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'long', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'text', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'unsigned_long', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'version', + optional: false, + }, + ], + returnType: 'boolean', + }, + ], + locationsAvailable: [Location.STATS], + examples: [ + 'FROM employees\n| STATS is_present = PRESENT(languages)', + 'FROM employees\n| STATS is_present = PRESENT(salary) BY languages', + 'FROM employees\n| WHERE emp_no == 10020\n| STATS is_present = TO_INTEGER(PRESENT(languages))', + ], +}; + // Do not edit this manually... generated by scripts/generate_function_definitions.ts const sampleDefinition: FunctionDefinition = { type: FunctionDefinitionTypes.AGG, @@ -2721,6 +3121,7 @@ const weightedAvgDefinition: FunctionDefinition = { ], }; export const aggFunctionDefinitions = [ + absentDefinition, avgDefinition, countDefinition, countDistinctDefinition, @@ -2731,6 +3132,7 @@ export const aggFunctionDefinitions = [ medianAbsoluteDeviationDefinition, minDefinition, percentileDefinition, + presentDefinition, sampleDefinition, stCentroidAggDefinition, stExtentAggDefinition, diff --git a/src/platform/packages/shared/kbn-esql-ast/src/definitions/generated/function_names.ts b/src/platform/packages/shared/kbn-esql-ast/src/definitions/generated/function_names.ts index faf58c407100f..556e9369e4e7d 100644 --- a/src/platform/packages/shared/kbn-esql-ast/src/definitions/generated/function_names.ts +++ b/src/platform/packages/shared/kbn-esql-ast/src/definitions/generated/function_names.ts @@ -28,6 +28,8 @@ export const esqlFunctionNames = [ 'ABS', + 'ABSENT', + 'ABSENT_OVER_TIME', 'ACOS', 'ASIN', 'ATAN', @@ -58,6 +60,7 @@ export const esqlFunctionNames = [ 'DATE_PARSE', 'DATE_TRUNC', 'DAY_NAME', + 'DECAY', 'E', 'ENDS_WITH', 'EXP', @@ -113,6 +116,8 @@ export const esqlFunctionNames = [ 'PERCENTILE', 'PI', 'POW', + 'PRESENT', + 'PRESENT_OVER_TIME', 'QSTR', 'RATE', 'REPEAT', @@ -168,6 +173,7 @@ export const esqlFunctionNames = [ 'TO_DATEPERIOD', 'TO_DATETIME', 'TO_DEGREES', + 'TO_DENSE_VECTOR', 'TO_DOUBLE', 'TO_GEOHASH', 'TO_GEOHEX', diff --git a/src/platform/packages/shared/kbn-esql-ast/src/definitions/generated/operators.ts b/src/platform/packages/shared/kbn-esql-ast/src/definitions/generated/operators.ts index 275c2ad0782de..db513da2d50e4 100644 --- a/src/platform/packages/shared/kbn-esql-ast/src/definitions/generated/operators.ts +++ b/src/platform/packages/shared/kbn-esql-ast/src/definitions/generated/operators.ts @@ -4579,7 +4579,7 @@ const notRlikeDefinition: FunctionDefinition = { name: 'not rlike', description: i18n.translate('kbn-esql-ast.esql.definitions.not_rlike', { defaultMessage: - 'Use `RLIKE` to filter data based on string patterns using using\nregular expressions. `RLIKE` usually acts on a field placed on\nthe left-hand side of the operator, but it can also act on a constant (literal)\nexpression. The right-hand side of the operator represents the pattern.', + 'Use `RLIKE` to filter data based on string patterns using\nregular expressions. `RLIKE` usually acts on a field placed on\nthe left-hand side of the operator, but it can also act on a constant (literal)\nexpression. The right-hand side of the operator represents the pattern.', }), preview: false, alias: undefined, @@ -5135,7 +5135,7 @@ const rlikeDefinition: FunctionDefinition = { name: 'rlike', description: i18n.translate('kbn-esql-ast.esql.definitions.rlike', { defaultMessage: - 'Use `RLIKE` to filter data based on string patterns using using\nregular expressions. `RLIKE` usually acts on a field placed on\nthe left-hand side of the operator, but it can also act on a constant (literal)\nexpression. The right-hand side of the operator represents the pattern.', + 'Use `RLIKE` to filter data based on string patterns using\nregular expressions. `RLIKE` usually acts on a field placed on\nthe left-hand side of the operator, but it can also act on a constant (literal)\nexpression. The right-hand side of the operator represents the pattern.', }), preview: false, alias: undefined, diff --git a/src/platform/packages/shared/kbn-esql-ast/src/definitions/generated/scalar_functions.ts b/src/platform/packages/shared/kbn-esql-ast/src/definitions/generated/scalar_functions.ts index bf809330ae8eb..e41a39105fa07 100644 --- a/src/platform/packages/shared/kbn-esql-ast/src/definitions/generated/scalar_functions.ts +++ b/src/platform/packages/shared/kbn-esql-ast/src/definitions/generated/scalar_functions.ts @@ -2301,6 +2301,250 @@ const dayNameDefinition: FunctionDefinition = { examples: ['ROW dt = to_datetime("1953-09-02T00:00:00.000Z")\n| EVAL weekday = DAY_NAME(dt);'], }; +// Do not edit this manually... generated by scripts/generate_function_definitions.ts +const decayDefinition: FunctionDefinition = { + type: FunctionDefinitionTypes.SCALAR, + name: 'decay', + description: i18n.translate('kbn-esql-ast.esql.definitions.decay', { + defaultMessage: + 'Calculates a relevance score that decays based on the distance of a numeric, spatial or date type value from a target origin, using configurable decay functions.', + }), + preview: true, + alias: undefined, + signatures: [ + { + params: [ + { + name: 'value', + type: 'cartesian_point', + optional: false, + }, + { + name: 'origin', + type: 'cartesian_point', + optional: false, + }, + { + name: 'scale', + type: 'double', + optional: false, + }, + { + name: 'options', + type: 'function_named_parameters', + mapParams: + "{name='offset', values=[], description='Distance from the origin where no decay occurs.'}, {name='type', values=[], description='Decay function to use: linear, exponential or gaussian.'}, {name='decay', values=[], description='Multiplier value returned at the scale distance from the origin.'}", + optional: true, + }, + ], + returnType: 'double', + }, + { + params: [ + { + name: 'value', + type: 'date', + optional: false, + }, + { + name: 'origin', + type: 'date', + optional: false, + }, + { + name: 'scale', + type: 'time_duration', + optional: false, + }, + { + name: 'options', + type: 'function_named_parameters', + mapParams: + "{name='offset', values=[], description='Distance from the origin where no decay occurs.'}, {name='type', values=[], description='Decay function to use: linear, exponential or gaussian.'}, {name='decay', values=[], description='Multiplier value returned at the scale distance from the origin.'}", + optional: true, + }, + ], + returnType: 'double', + }, + { + params: [ + { + name: 'value', + type: 'date_nanos', + optional: false, + }, + { + name: 'origin', + type: 'date_nanos', + optional: false, + }, + { + name: 'scale', + type: 'time_duration', + optional: false, + }, + { + name: 'options', + type: 'function_named_parameters', + mapParams: + "{name='offset', values=[], description='Distance from the origin where no decay occurs.'}, {name='type', values=[], description='Decay function to use: linear, exponential or gaussian.'}, {name='decay', values=[], description='Multiplier value returned at the scale distance from the origin.'}", + optional: true, + }, + ], + returnType: 'double', + }, + { + params: [ + { + name: 'value', + type: 'double', + optional: false, + }, + { + name: 'origin', + type: 'double', + optional: false, + }, + { + name: 'scale', + type: 'double', + optional: false, + }, + { + name: 'options', + type: 'function_named_parameters', + mapParams: + "{name='offset', values=[], description='Distance from the origin where no decay occurs.'}, {name='type', values=[], description='Decay function to use: linear, exponential or gaussian.'}, {name='decay', values=[], description='Multiplier value returned at the scale distance from the origin.'}", + optional: true, + }, + ], + returnType: 'double', + }, + { + params: [ + { + name: 'value', + type: 'geo_point', + optional: false, + }, + { + name: 'origin', + type: 'geo_point', + optional: false, + }, + { + name: 'scale', + type: 'keyword', + optional: false, + }, + { + name: 'options', + type: 'function_named_parameters', + mapParams: + "{name='offset', values=[], description='Distance from the origin where no decay occurs.'}, {name='type', values=[], description='Decay function to use: linear, exponential or gaussian.'}, {name='decay', values=[], description='Multiplier value returned at the scale distance from the origin.'}", + optional: true, + }, + ], + returnType: 'double', + }, + { + params: [ + { + name: 'value', + type: 'geo_point', + optional: false, + }, + { + name: 'origin', + type: 'geo_point', + optional: false, + }, + { + name: 'scale', + type: 'text', + optional: false, + }, + { + name: 'options', + type: 'function_named_parameters', + mapParams: + "{name='offset', values=[], description='Distance from the origin where no decay occurs.'}, {name='type', values=[], description='Decay function to use: linear, exponential or gaussian.'}, {name='decay', values=[], description='Multiplier value returned at the scale distance from the origin.'}", + optional: true, + }, + ], + returnType: 'double', + }, + { + params: [ + { + name: 'value', + type: 'integer', + optional: false, + }, + { + name: 'origin', + type: 'integer', + optional: false, + }, + { + name: 'scale', + type: 'integer', + optional: false, + }, + { + name: 'options', + type: 'function_named_parameters', + mapParams: + "{name='offset', values=[], description='Distance from the origin where no decay occurs.'}, {name='type', values=[], description='Decay function to use: linear, exponential or gaussian.'}, {name='decay', values=[], description='Multiplier value returned at the scale distance from the origin.'}", + optional: true, + }, + ], + returnType: 'double', + }, + { + params: [ + { + name: 'value', + type: 'long', + optional: false, + }, + { + name: 'origin', + type: 'long', + optional: false, + }, + { + name: 'scale', + type: 'long', + optional: false, + }, + { + name: 'options', + type: 'function_named_parameters', + mapParams: + "{name='offset', values=[], description='Distance from the origin where no decay occurs.'}, {name='type', values=[], description='Decay function to use: linear, exponential or gaussian.'}, {name='decay', values=[], description='Multiplier value returned at the scale distance from the origin.'}", + optional: true, + }, + ], + returnType: 'double', + }, + ], + locationsAvailable: [ + Location.EVAL, + Location.ROW, + Location.SORT, + Location.WHERE, + Location.STATS, + Location.STATS_BY, + Location.STATS_WHERE, + Location.STATS_TIMESERIES, + Location.COMPLETION, + ], + examples: [ + 'FROM employees\n| EVAL decay_result = decay(salary, 0, 100000, {"offset": 5, "decay": 0.5, "type": "linear"})\n| SORT decay_result DESC', + ], +}; + // Do not edit this manually... generated by scripts/generate_function_definitions.ts const eDefinition: FunctionDefinition = { type: FunctionDefinitionTypes.SCALAR, @@ -11328,7 +11572,6 @@ const stGeohashDefinition: FunctionDefinition = { defaultMessage: 'Calculates the `geohash` of the supplied geo_point at the specified precision.\nThe result is long encoded. Use TO_STRING to convert the result to a string,\nTO_LONG to convert it to a `long`, or TO_GEOSHAPE to calculate\nthe `geo_shape` bounding geometry.\n\nThese functions are related to the `geo_grid` query\nand the `geohash_grid` aggregation.', }), - ignoreAsSuggestion: true, preview: true, alias: undefined, signatures: [ @@ -11342,7 +11585,7 @@ const stGeohashDefinition: FunctionDefinition = { { name: 'precision', type: 'integer', - optional: true, + optional: false, }, ], returnType: 'geohash', @@ -11357,7 +11600,7 @@ const stGeohashDefinition: FunctionDefinition = { { name: 'precision', type: 'integer', - optional: true, + optional: false, }, { name: 'bounds', @@ -11392,7 +11635,6 @@ const stGeohexDefinition: FunctionDefinition = { defaultMessage: 'Calculates the `geohex`, the H3 cell-id, of the supplied geo_point at the specified precision.\nThe result is long encoded. Use TO_STRING to convert the result to a string,\nTO_LONG to convert it to a `long`, or TO_GEOSHAPE to calculate\nthe `geo_shape` bounding geometry.\n\nThese functions are related to the `geo_grid` query\nand the `geohex_grid` aggregation.', }), - ignoreAsSuggestion: true, preview: true, alias: undefined, signatures: [ @@ -11459,7 +11701,6 @@ const stGeotileDefinition: FunctionDefinition = { defaultMessage: 'Calculates the `geotile` of the supplied geo_point at the specified precision.\nThe result is long encoded. Use TO_STRING to convert the result to a string,\nTO_LONG to convert it to a `long`, or TO_GEOSHAPE to calculate\nthe `geo_shape` bounding geometry.\n\nThese functions are related to the `geo_grid` query\nand the `geotile_grid` aggregation.', }), - ignoreAsSuggestion: true, preview: true, alias: undefined, signatures: [ @@ -13293,6 +13534,32 @@ const toDegreesDefinition: FunctionDefinition = { examples: ['ROW rad = [1.57, 3.14, 4.71]\n| EVAL deg = TO_DEGREES(rad)'], }; +// Do not edit this manually... generated by scripts/generate_function_definitions.ts +const toDenseVectorDefinition: FunctionDefinition = { + type: FunctionDefinitionTypes.SCALAR, + name: 'to_dense_vector', + description: i18n.translate('kbn-esql-ast.esql.definitions.to_dense_vector', { + defaultMessage: + 'Converts a multi-valued input of numbers, or a hexadecimal string, to a dense_vector.', + }), + ignoreAsSuggestion: true, + preview: false, + alias: undefined, + signatures: [], + locationsAvailable: [ + Location.EVAL, + Location.ROW, + Location.SORT, + Location.WHERE, + Location.STATS, + Location.STATS_BY, + Location.STATS_WHERE, + Location.STATS_TIMESERIES, + Location.COMPLETION, + ], + examples: ['row ints = [1, 2, 3]\n| eval vector = to_dense_vector(ints)\n| keep vector'], +}; + // Do not edit this manually... generated by scripts/generate_function_definitions.ts const toDoubleDefinition: FunctionDefinition = { type: FunctionDefinitionTypes.SCALAR, @@ -13437,9 +13704,8 @@ const toGeohashDefinition: FunctionDefinition = { name: 'to_geohash', description: i18n.translate('kbn-esql-ast.esql.definitions.to_geohash', { defaultMessage: - 'Converts an input value to a `geohash` value.\nA string will only be successfully converted if it respects the\n`geohash` format.', + 'Converts an input value to a `geohash` value.\nA string will only be successfully converted if it respects the\n`geohash` format, as described for the\ngeohash grid aggregation.', }), - ignoreAsSuggestion: true, preview: true, alias: undefined, signatures: [ @@ -13504,9 +13770,8 @@ const toGeohexDefinition: FunctionDefinition = { name: 'to_geohex', description: i18n.translate('kbn-esql-ast.esql.definitions.to_geohex', { defaultMessage: - 'Converts an input value to a `geohex` value.\nA string will only be successfully converted if it respects the\n`geohex` format.', + 'Converts an input value to a `geohex` value.\nA string will only be successfully converted if it respects the\n`geohex` format, as described for the\ngeohex grid aggregation.', }), - ignoreAsSuggestion: true, preview: true, alias: undefined, signatures: [ @@ -13725,9 +13990,8 @@ const toGeotileDefinition: FunctionDefinition = { name: 'to_geotile', description: i18n.translate('kbn-esql-ast.esql.definitions.to_geotile', { defaultMessage: - 'Converts an input value to a `geotile` value.\nA string will only be successfully converted if it respects the\n`geotile` format.', + 'Converts an input value to a `geotile` value.\nA string will only be successfully converted if it respects the\n`geotile` format, as described for the\ngeotile grid aggregation.', }), - ignoreAsSuggestion: true, preview: true, alias: undefined, signatures: [ @@ -15081,6 +15345,7 @@ export const scalarFunctionDefinitions = [ dateParseDefinition, dateTruncDefinition, dayNameDefinition, + decayDefinition, eDefinition, endsWithDefinition, expDefinition, @@ -15173,6 +15438,7 @@ export const scalarFunctionDefinitions = [ toDateperiodDefinition, toDatetimeDefinition, toDegreesDefinition, + toDenseVectorDefinition, toDoubleDefinition, toGeohashDefinition, toGeohexDefinition, diff --git a/src/platform/packages/shared/kbn-esql-ast/src/definitions/generated/time_series_agg_functions.ts b/src/platform/packages/shared/kbn-esql-ast/src/definitions/generated/time_series_agg_functions.ts index d65bd91c1bb79..8a55baf69d4b8 100644 --- a/src/platform/packages/shared/kbn-esql-ast/src/definitions/generated/time_series_agg_functions.ts +++ b/src/platform/packages/shared/kbn-esql-ast/src/definitions/generated/time_series_agg_functions.ts @@ -30,6 +30,204 @@ import { i18n } from '@kbn/i18n'; import { Location } from '../../commands_registry/types'; import { type FunctionDefinition, FunctionDefinitionTypes } from '../types'; +// Do not edit this manually... generated by scripts/generate_function_definitions.ts +const absentOverTimeDefinition: FunctionDefinition = { + type: FunctionDefinitionTypes.TIME_SERIES_AGG, + name: 'absent_over_time', + description: i18n.translate('kbn-esql-ast.esql.definitions.absent_over_time', { + defaultMessage: 'The absence of a field in the output result over time range.', + }), + ignoreAsSuggestion: true, + preview: false, + alias: undefined, + signatures: [ + { + params: [ + { + name: 'field', + type: 'boolean', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'cartesian_point', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'cartesian_shape', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'date', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'date_nanos', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'double', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'geo_point', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'geo_shape', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'geohash', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'geohex', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'geotile', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'integer', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'ip', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'keyword', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'long', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'text', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'unsigned_long', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'version', + optional: false, + }, + ], + returnType: 'boolean', + }, + ], + locationsAvailable: [Location.STATS_TIMESERIES], + examples: [ + 'TS k8s\n| WHERE cluster == "prod" AND pod == "two"\n| STATS events_received = max(absent_over_time(events_received)) BY pod, time_bucket = tbucket(2 minute)', + ], +}; + // Do not edit this manually... generated by scripts/generate_function_definitions.ts const avgOverTimeDefinition: FunctionDefinition = { type: FunctionDefinitionTypes.TIME_SERIES_AGG, @@ -1198,6 +1396,204 @@ const minOverTimeDefinition: FunctionDefinition = { ], }; +// Do not edit this manually... generated by scripts/generate_function_definitions.ts +const presentOverTimeDefinition: FunctionDefinition = { + type: FunctionDefinitionTypes.TIME_SERIES_AGG, + name: 'present_over_time', + description: i18n.translate('kbn-esql-ast.esql.definitions.present_over_time', { + defaultMessage: 'The presence of a field in the output result over time range.', + }), + ignoreAsSuggestion: true, + preview: false, + alias: undefined, + signatures: [ + { + params: [ + { + name: 'field', + type: 'boolean', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'cartesian_point', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'cartesian_shape', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'date', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'date_nanos', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'double', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'geo_point', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'geo_shape', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'geohash', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'geohex', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'geotile', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'integer', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'ip', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'keyword', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'long', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'text', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'unsigned_long', + optional: false, + }, + ], + returnType: 'boolean', + }, + { + params: [ + { + name: 'field', + type: 'version', + optional: false, + }, + ], + returnType: 'boolean', + }, + ], + locationsAvailable: [Location.STATS_TIMESERIES], + examples: [ + 'TS k8s\n| WHERE cluster == "prod" AND pod == "two"\n| STATS events_received = max(present_over_time(events_received)) BY pod, time_bucket = tbucket(2 minute)', + ], +}; + // Do not edit this manually... generated by scripts/generate_function_definitions.ts const rateDefinition: FunctionDefinition = { type: FunctionDefinitionTypes.TIME_SERIES_AGG, @@ -1246,6 +1642,7 @@ const rateDefinition: FunctionDefinition = { ], }; export const timeSeriesAggFunctionDefinitions = [ + absentOverTimeDefinition, avgOverTimeDefinition, countDistinctOverTimeDefinition, countOverTimeDefinition, @@ -1253,5 +1650,6 @@ export const timeSeriesAggFunctionDefinitions = [ lastOverTimeDefinition, maxOverTimeDefinition, minOverTimeDefinition, + presentOverTimeDefinition, rateDefinition, ];