From a20c16be0dd782f5be633a2ad8e5dc8c4ba757f1 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Tue, 17 Jun 2025 21:48:08 +0400 Subject: [PATCH] Add TDigestExecutionHint to metric aggregations --- output/openapi/elasticsearch-openapi.json | 16 +++ .../elasticsearch-serverless-openapi.json | 16 +++ output/schema/schema.json | 119 +++++++++++++----- output/typescript/types.ts | 5 + specification/_types/aggregations/metric.ts | 23 ++++ 5 files changed, 147 insertions(+), 32 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 8c9963fdd3..273e2b1144 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -56325,11 +56325,21 @@ "compression": { "description": "Limits the maximum number of nodes used by the underlying TDigest algorithm to `20 * compression`, enabling control of memory usage and approximation error.", "type": "number" + }, + "execution_hint": { + "$ref": "#/components/schemas/_types.aggregations.TDigestExecutionHint" } } } ] }, + "_types.aggregations.TDigestExecutionHint": { + "type": "string", + "enum": [ + "default", + "high_accuracy" + ] + }, "_types.aggregations.BucketScriptAggregation": { "allOf": [ { @@ -57757,6 +57767,9 @@ "compression": { "description": "Limits the maximum number of nodes used by the underlying TDigest algorithm to `20 * compression`, enabling control of memory usage and approximation error.", "type": "number" + }, + "execution_hint": { + "$ref": "#/components/schemas/_types.aggregations.TDigestExecutionHint" } } } @@ -58245,6 +58258,9 @@ "compression": { "description": "Limits the maximum number of nodes used by the underlying TDigest algorithm to `20 * compression`, enabling control of memory usage and approximation error.", "type": "number" + }, + "execution_hint": { + "$ref": "#/components/schemas/_types.aggregations.TDigestExecutionHint" } } }, diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 718c03fc86..e1cbd93dfd 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -35147,11 +35147,21 @@ "compression": { "description": "Limits the maximum number of nodes used by the underlying TDigest algorithm to `20 * compression`, enabling control of memory usage and approximation error.", "type": "number" + }, + "execution_hint": { + "$ref": "#/components/schemas/_types.aggregations.TDigestExecutionHint" } } } ] }, + "_types.aggregations.TDigestExecutionHint": { + "type": "string", + "enum": [ + "default", + "high_accuracy" + ] + }, "_types.aggregations.BucketScriptAggregation": { "allOf": [ { @@ -36579,6 +36589,9 @@ "compression": { "description": "Limits the maximum number of nodes used by the underlying TDigest algorithm to `20 * compression`, enabling control of memory usage and approximation error.", "type": "number" + }, + "execution_hint": { + "$ref": "#/components/schemas/_types.aggregations.TDigestExecutionHint" } } } @@ -37067,6 +37080,9 @@ "compression": { "description": "Limits the maximum number of nodes used by the underlying TDigest algorithm to `20 * compression`, enabling control of memory usage and approximation error.", "type": "number" + }, + "execution_hint": { + "$ref": "#/components/schemas/_types.aggregations.TDigestExecutionHint" } } }, diff --git a/output/schema/schema.json b/output/schema/schema.json index 6e426dc138..827b2ca55e 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -59792,9 +59792,22 @@ "namespace": "_types" } } + }, + { + "description": "The default implementation of TDigest is optimized for performance, scaling to millions or even billions of sample values while maintaining acceptable accuracy levels (close to 1% relative error for millions of samples in some cases).\nTo use an implementation optimized for accuracy, set this parameter to high_accuracy instead.", + "name": "execution_hint", + "required": false, + "serverDefault": "default", + "type": { + "kind": "instance_of", + "type": { + "name": "TDigestExecutionHint", + "namespace": "_types.aggregations" + } + } } ], - "specLocation": "_types/aggregations/metric.ts#L57-L62" + "specLocation": "_types/aggregations/metric.ts#L57-L68" }, { "kind": "interface", @@ -60434,7 +60447,7 @@ } } ], - "specLocation": "_types/aggregations/metric.ts#L87-L99" + "specLocation": "_types/aggregations/metric.ts#L93-L105" }, { "kind": "enum", @@ -60464,7 +60477,7 @@ "name": "CardinalityExecutionMode", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/metric.ts#L64-L85" + "specLocation": "_types/aggregations/metric.ts#L70-L91" }, { "kind": "interface", @@ -62339,7 +62352,7 @@ } } ], - "specLocation": "_types/aggregations/metric.ts#L101-L106" + "specLocation": "_types/aggregations/metric.ts#L107-L112" }, { "kind": "interface", @@ -62896,7 +62909,7 @@ } } ], - "specLocation": "_types/aggregations/metric.ts#L108-L117" + "specLocation": "_types/aggregations/metric.ts#L114-L123" }, { "kind": "interface", @@ -62975,7 +62988,7 @@ } } ], - "specLocation": "_types/aggregations/metric.ts#L119-L122" + "specLocation": "_types/aggregations/metric.ts#L125-L128" }, { "kind": "interface", @@ -63385,7 +63398,7 @@ } } ], - "specLocation": "_types/aggregations/metric.ts#L124-L149" + "specLocation": "_types/aggregations/metric.ts#L130-L155" }, { "kind": "interface", @@ -63407,7 +63420,7 @@ } } ], - "specLocation": "_types/aggregations/metric.ts#L158-L163" + "specLocation": "_types/aggregations/metric.ts#L164-L169" }, { "kind": "interface", @@ -63429,7 +63442,7 @@ } } ], - "specLocation": "_types/aggregations/metric.ts#L151-L156" + "specLocation": "_types/aggregations/metric.ts#L157-L162" }, { "kind": "interface", @@ -63722,7 +63735,7 @@ } } ], - "specLocation": "_types/aggregations/metric.ts#L225-L230" + "specLocation": "_types/aggregations/metric.ts#L237-L242" }, { "kind": "interface", @@ -65341,7 +65354,7 @@ "namespace": "_types.aggregations" }, "properties": [], - "specLocation": "_types/aggregations/metric.ts#L165-L165" + "specLocation": "_types/aggregations/metric.ts#L171-L171" }, { "kind": "interface", @@ -65403,9 +65416,22 @@ "namespace": "_types" } } + }, + { + "description": "The default implementation of TDigest is optimized for performance, scaling to millions or even billions of sample values while maintaining acceptable accuracy levels (close to 1% relative error for millions of samples in some cases).\nTo use an implementation optimized for accuracy, set this parameter to high_accuracy instead.", + "name": "execution_hint", + "required": false, + "serverDefault": "default", + "type": { + "kind": "instance_of", + "type": { + "name": "TDigestExecutionHint", + "namespace": "_types.aggregations" + } + } } ], - "specLocation": "_types/aggregations/metric.ts#L167-L176" + "specLocation": "_types/aggregations/metric.ts#L173-L188" }, { "kind": "interface", @@ -65483,7 +65509,7 @@ "namespace": "_types.aggregations" }, "properties": [], - "specLocation": "_types/aggregations/metric.ts#L178-L178" + "specLocation": "_types/aggregations/metric.ts#L190-L190" }, { "kind": "interface", @@ -66477,7 +66503,7 @@ } } ], - "specLocation": "_types/aggregations/metric.ts#L180-L202" + "specLocation": "_types/aggregations/metric.ts#L192-L214" }, { "kind": "type_alias", @@ -66606,7 +66632,7 @@ } } ], - "specLocation": "_types/aggregations/metric.ts#L204-L223" + "specLocation": "_types/aggregations/metric.ts#L216-L235" }, { "kind": "interface", @@ -67133,7 +67159,7 @@ } } ], - "specLocation": "_types/aggregations/metric.ts#L239-L250" + "specLocation": "_types/aggregations/metric.ts#L262-L273" }, { "kind": "enum", @@ -67151,7 +67177,7 @@ "name": "RateMode", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/metric.ts#L252-L261" + "specLocation": "_types/aggregations/metric.ts#L275-L284" }, { "kind": "interface", @@ -67402,7 +67428,7 @@ } } ], - "specLocation": "_types/aggregations/metric.ts#L263-L289" + "specLocation": "_types/aggregations/metric.ts#L286-L312" }, { "kind": "interface", @@ -68626,7 +68652,7 @@ "namespace": "_types.aggregations" }, "properties": [], - "specLocation": "_types/aggregations/metric.ts#L291-L291" + "specLocation": "_types/aggregations/metric.ts#L314-L314" }, { "kind": "interface", @@ -68931,7 +68957,7 @@ } } ], - "specLocation": "_types/aggregations/metric.ts#L293-L299" + "specLocation": "_types/aggregations/metric.ts#L316-L322" }, { "kind": "interface", @@ -69021,7 +69047,7 @@ "namespace": "_types.aggregations" }, "properties": [], - "specLocation": "_types/aggregations/metric.ts#L301-L301" + "specLocation": "_types/aggregations/metric.ts#L324-L324" }, { "kind": "interface", @@ -69058,9 +69084,38 @@ "namespace": "_types" } } + }, + { + "description": "The default implementation of TDigest is optimized for performance, scaling to millions or even billions of sample values while maintaining acceptable accuracy levels (close to 1% relative error for millions of samples in some cases).\nTo use an implementation optimized for accuracy, set this parameter to high_accuracy instead.", + "name": "execution_hint", + "required": false, + "serverDefault": "default", + "type": { + "kind": "instance_of", + "type": { + "name": "TDigestExecutionHint", + "namespace": "_types.aggregations" + } + } } ], - "specLocation": "_types/aggregations/metric.ts#L232-L237" + "specLocation": "_types/aggregations/metric.ts#L244-L255" + }, + { + "kind": "enum", + "members": [ + { + "name": "default" + }, + { + "name": "high_accuracy" + } + ], + "name": { + "name": "TDigestExecutionHint", + "namespace": "_types.aggregations" + }, + "specLocation": "_types/aggregations/metric.ts#L257-L260" }, { "kind": "interface", @@ -69198,7 +69253,7 @@ } } ], - "specLocation": "_types/aggregations/metric.ts#L303-L317" + "specLocation": "_types/aggregations/metric.ts#L326-L340" }, { "kind": "enum", @@ -69220,7 +69275,7 @@ "name": "TTestType", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/metric.ts#L331-L344" + "specLocation": "_types/aggregations/metric.ts#L354-L367" }, { "kind": "interface", @@ -69718,7 +69773,7 @@ } } ], - "specLocation": "_types/aggregations/metric.ts#L319-L329" + "specLocation": "_types/aggregations/metric.ts#L342-L352" }, { "kind": "interface", @@ -70056,7 +70111,7 @@ } } ], - "specLocation": "_types/aggregations/metric.ts#L346-L406" + "specLocation": "_types/aggregations/metric.ts#L369-L429" }, { "kind": "interface", @@ -70227,7 +70282,7 @@ } } ], - "specLocation": "_types/aggregations/metric.ts#L408-L425" + "specLocation": "_types/aggregations/metric.ts#L431-L448" }, { "kind": "interface", @@ -70249,7 +70304,7 @@ } } ], - "specLocation": "_types/aggregations/metric.ts#L427-L432" + "specLocation": "_types/aggregations/metric.ts#L450-L455" }, { "kind": "interface", @@ -70380,7 +70435,7 @@ "namespace": "_types.aggregations" }, "properties": [], - "specLocation": "_types/aggregations/metric.ts#L434-L434" + "specLocation": "_types/aggregations/metric.ts#L457-L457" }, { "kind": "enum", @@ -70420,7 +70475,7 @@ "name": "ValueType", "namespace": "_types.aggregations" }, - "specLocation": "_types/aggregations/metric.ts#L436-L447" + "specLocation": "_types/aggregations/metric.ts#L459-L470" }, { "kind": "interface", @@ -70665,7 +70720,7 @@ } } ], - "specLocation": "_types/aggregations/metric.ts#L449-L463" + "specLocation": "_types/aggregations/metric.ts#L472-L486" }, { "kind": "interface", @@ -70710,7 +70765,7 @@ } } ], - "specLocation": "_types/aggregations/metric.ts#L465-L475" + "specLocation": "_types/aggregations/metric.ts#L488-L498" }, { "kind": "interface", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 23302d1b34..78457c7139 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -3242,6 +3242,7 @@ export interface AggregationsBoxPlotAggregate extends AggregationsAggregateBase export interface AggregationsBoxplotAggregation extends AggregationsMetricAggregationBase { compression?: double + execution_hint?: AggregationsTDigestExecutionHint } export interface AggregationsBucketAggregationBase { @@ -3901,6 +3902,7 @@ export interface AggregationsMedianAbsoluteDeviationAggregate extends Aggregatio export interface AggregationsMedianAbsoluteDeviationAggregation extends AggregationsFormatMetricAggregationBase { compression?: double + execution_hint?: AggregationsTDigestExecutionHint } export interface AggregationsMetricAggregationBase { @@ -4312,8 +4314,11 @@ export interface AggregationsSumBucketAggregation extends AggregationsPipelineAg export interface AggregationsTDigest { compression?: integer + execution_hint?: AggregationsTDigestExecutionHint } +export type AggregationsTDigestExecutionHint = 'default' | 'high_accuracy' + export interface AggregationsTDigestPercentileRanksAggregate extends AggregationsPercentilesAggregateBase { } diff --git a/specification/_types/aggregations/metric.ts b/specification/_types/aggregations/metric.ts index ea40cf5aee..28abf6486a 100644 --- a/specification/_types/aggregations/metric.ts +++ b/specification/_types/aggregations/metric.ts @@ -59,6 +59,12 @@ export class BoxplotAggregation extends MetricAggregationBase { * Limits the maximum number of nodes used by the underlying TDigest algorithm to `20 * compression`, enabling control of memory usage and approximation error. */ compression?: double + /** + * The default implementation of TDigest is optimized for performance, scaling to millions or even billions of sample values while maintaining acceptable accuracy levels (close to 1% relative error for millions of samples in some cases). + * To use an implementation optimized for accuracy, set this parameter to high_accuracy instead. + * @server_default default + */ + execution_hint?: TDigestExecutionHint } export enum CardinalityExecutionMode { @@ -173,6 +179,12 @@ export class MedianAbsoluteDeviationAggregation extends FormatMetricAggregationB * @server_default 1000 */ compression?: double + /** + * The default implementation of TDigest is optimized for performance, scaling to millions or even billions of sample values while maintaining acceptable accuracy levels (close to 1% relative error for millions of samples in some cases). + * To use an implementation optimized for accuracy, set this parameter to high_accuracy instead. + * @server_default default + */ + execution_hint?: TDigestExecutionHint } export class MinAggregation extends FormatMetricAggregationBase {} @@ -234,6 +246,17 @@ export class TDigest { * Limits the maximum number of nodes used by the underlying TDigest algorithm to `20 * compression`, enabling control of memory usage and approximation error. */ compression?: integer + /** + * The default implementation of TDigest is optimized for performance, scaling to millions or even billions of sample values while maintaining acceptable accuracy levels (close to 1% relative error for millions of samples in some cases). + * To use an implementation optimized for accuracy, set this parameter to high_accuracy instead. + * @server_default default + */ + execution_hint?: TDigestExecutionHint +} + +export enum TDigestExecutionHint { + default, + high_accuracy } export class RateAggregation extends FormatMetricAggregationBase {