Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ export const fieldTypes: readonly string[] = [
'function_named_parameters',
'aggregate_metric_double',
'dense_vector',
'histogram',
'exponential_histogram',
'tdigest',
] as const;

export type FieldType = (typeof fieldTypes)[number];
Expand Down Expand Up @@ -71,6 +74,9 @@ export const userDefinedTypes = [
'time_duration',
'date_period',
'param', // Defines a named param such as ?value or ??field
'histogram',
'exponential_histogram',
'tdigest',
] as const;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const SPATIAL_FIELDS = ['geo_point', 'geo_shape', 'point', 'shape'];
const SOURCE_FIELD = '_source';
const TSDB_COUNTER_FIELDS_PREFIX = 'counter_';
const UNKNOWN_FIELD = 'unknown';
const HISTOGRAM_FIELDS = ['exponential_histogram', 'tdigest'];

/**
* Check if a column is sortable.
Expand Down Expand Up @@ -51,6 +52,10 @@ const isGroupable = (type: string | undefined, esType: string | undefined): bool
if (esType && esType.indexOf(TSDB_COUNTER_FIELDS_PREFIX) !== -1) {
return false;
}
// we don't allow grouping on histogram fields (pre-aggregated data)
if (type && HISTOGRAM_FIELDS.includes(type)) {
return false;
}
return true;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ describe('utils/kbn_field_types', () => {
KBN_FIELD_TYPES.CONFLICT,
KBN_FIELD_TYPES.DATE,
KBN_FIELD_TYPES.DATE_RANGE,
KBN_FIELD_TYPES.EXPONENTIAL_HISTOGRAM,
KBN_FIELD_TYPES.GEO_POINT,
KBN_FIELD_TYPES.GEO_SHAPE,
KBN_FIELD_TYPES.HISTOGRAM,
Expand All @@ -88,6 +89,7 @@ describe('utils/kbn_field_types', () => {
KBN_FIELD_TYPES.NUMBER_RANGE,
KBN_FIELD_TYPES.OBJECT,
KBN_FIELD_TYPES.STRING,
KBN_FIELD_TYPES.TDIGEST,
KBN_FIELD_TYPES.UNKNOWN,
]);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,16 @@ export const createKbnFieldTypes = (): KbnFieldType[] => [
filterable: true,
esTypes: [ES_FIELD_TYPES.HISTOGRAM],
}),
new KbnFieldType({
name: KBN_FIELD_TYPES.EXPONENTIAL_HISTOGRAM,
filterable: false,
esTypes: [ES_FIELD_TYPES.EXPONENTIAL_HISTOGRAM],
}),
new KbnFieldType({
name: KBN_FIELD_TYPES.TDIGEST,
filterable: false,
esTypes: [ES_FIELD_TYPES.TDIGEST],
}),
new KbnFieldType({
name: KBN_FIELD_TYPES.CONFLICT,
}),
Expand Down
4 changes: 4 additions & 0 deletions src/platform/packages/shared/kbn-field-types/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ export enum ES_FIELD_TYPES {
MURMUR3 = 'murmur3',

HISTOGRAM = 'histogram',
EXPONENTIAL_HISTOGRAM = 'exponential_histogram',
TDIGEST = 'tdigest',
}

/** @public **/
Expand All @@ -85,5 +87,7 @@ export enum KBN_FIELD_TYPES {
OBJECT = 'object',
NESTED = 'nested',
HISTOGRAM = 'histogram',
EXPONENTIAL_HISTOGRAM = 'exponential_histogram',
TDIGEST = 'tdigest',
MISSING = 'missing',
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@ const supportedTypes = new Set([
KNOWN_FIELD_TYPES.IP,
]);

const unsupportedTypes = new Set([
KNOWN_FIELD_TYPES.EXPONENTIAL_HISTOGRAM,
KNOWN_FIELD_TYPES.TDIGEST,
]);

export const fieldSupportsBreakdown = (field: DataViewField) =>
supportedTypes.has(field.type as KNOWN_FIELD_TYPES) &&
!unsupportedTypes.has(field.type as KNOWN_FIELD_TYPES) &&
field.aggregatable &&
!field.scripted &&
field.timeSeriesMetric !== 'counter';
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export enum KNOWN_FIELD_TYPES {
GEO_POINT = 'geo_point',
GEO_SHAPE = 'geo_shape',
HISTOGRAM = 'histogram',
EXPONENTIAL_HISTOGRAM = 'exponential_histogram',
TDIGEST = 'tdigest',
IP = 'ip',
IP_RANGE = 'ip_range',
FLATTENED = 'flattened',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ export function getFieldTypeDescription(type?: string) {
return i18n.translate('fieldUtils.fieldNameDescription.histogramField', {
defaultMessage: 'Pre-aggregated numerical values in the form of a histogram.',
});
case KNOWN_FIELD_TYPES.EXPONENTIAL_HISTOGRAM:
return i18n.translate('fieldUtils.fieldNameDescription.exponentialHistogramField', {
defaultMessage: 'Pre-aggregated numerical values in the form of an exponential histogram.',
});
case KNOWN_FIELD_TYPES.TDIGEST:
return i18n.translate('fieldUtils.fieldNameDescription.tdigestField', {
defaultMessage: 'Pre-aggregated numerical values for percentile calculations.',
});
case KNOWN_FIELD_TYPES.IP:
return i18n.translate('fieldUtils.fieldNameDescription.ipAddressField', {
defaultMessage: 'IPv4 and IPv6 addresses.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ export function getFieldTypeName(type?: string) {
return i18n.translate('fieldUtils.fieldNameIcons.histogramFieldAriaLabel', {
defaultMessage: 'Histogram',
});
case KNOWN_FIELD_TYPES.EXPONENTIAL_HISTOGRAM:
return i18n.translate('fieldUtils.fieldNameIcons.exponentialHistogramFieldAriaLabel', {
defaultMessage: 'Exponential histogram',
});
case KNOWN_FIELD_TYPES.TDIGEST:
return i18n.translate('fieldUtils.fieldNameIcons.tdigestFieldAriaLabel', {
defaultMessage: 'T-Digest',
});
case KNOWN_FIELD_TYPES.IP:
return i18n.translate('fieldUtils.fieldNameIcons.ipAddressFieldAriaLabel', {
defaultMessage: 'IP address',
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ export const typeToEuiIconMap = {
rank_feature: { iconType: 'tokenRankFeature' },
rank_features: { iconType: 'tokenRankFeatures' },
histogram: { iconType: 'tokenHistogram' },
exponential_histogram: { iconType: 'tokenHistogram' },
tdigest: { iconType: 'tokenHistogram' },
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

???

I don't see any other options

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is tdigest?

Copy link
Contributor Author

@bartoval bartoval Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah sorry, the Issue was updated #242699

elastic/elasticsearch#137649

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is ok to use the same. These 2 field types are connected with histograms. ES is going to add support for the existing histogram type in ESQL by casting to one of these

_source: { iconType: 'editorCodeBlock', color: 'gray' },
point: { iconType: 'tokenShape' }, // there is no separate icon for `point` yet
shape: { iconType: 'tokenShape' },
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export const NUMERIC_TYPES = [
ES_FIELD_TYPES.SCALED_FLOAT,
ES_FIELD_TYPES.UNSIGNED_LONG,
ES_FIELD_TYPES.HISTOGRAM,
ES_FIELD_TYPES.EXPONENTIAL_HISTOGRAM,
ES_FIELD_TYPES.TDIGEST,
];

// For the dimensions, the field MUST have `time_series_dimension` attribute set
Expand Down