Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .changeset/percentile-aggfn-quantile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'@hyperdx/common-utils': patch
'@hyperdx/api': patch
'@hyperdx/app': patch
---

fix: render percentile aggregations (`p50`, `p90`, `p95`, `p99`) as `quantile`
at the matching level. A chart config with `aggFn: 'p95'` rendered as the
nonexistent ClickHouse function `p95If`. The AI assistant now returns
percentiles with a level instead of a bare `quantile` (median), and v1 metric
chart conversion keeps the percentile level.
46 changes: 45 additions & 1 deletion packages/api/src/controllers/__tests__/ai.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ function setConfig(overrides: Record<string, string | undefined>) {
Object.assign(mockConfig, overrides);
}

import { getAIModel } from '@/controllers/ai';
import { DisplayType, SourceKind } from '@hyperdx/common-utils/dist/types';

import { getAIModel, getChartConfigFromResolvedConfig } from '@/controllers/ai';
import type { ISource } from '@/models/source';

beforeEach(() => {
setConfig({});
Expand Down Expand Up @@ -252,3 +255,44 @@ describe('openai provider', () => {
});
});
});

describe('getChartConfigFromResolvedConfig', () => {
// @ts-expect-error mock source only has the fields getChartConfigFromResolvedConfig reads
const source: ISource = {
id: 'source-id',
kind: SourceKind.Trace,
connection: 'connection-id',
from: { databaseName: 'default', tableName: 'otel_traces' },
timestampValueExpression: 'Timestamp',
};

it('maps percentile aggregations to quantile with a level', () => {
const result = getChartConfigFromResolvedConfig(
{
displayType: DisplayType.Table,
select: [
{ aggregationFunction: 'max', property: 'Duration' },
{
aggregationFunction: 'p95',
property: 'Duration',
condition: "ServiceName = 'api'",
},
],
groupBy: 'SpanName',
timeRange: 'Past 1h',
},
source,
);

expect(result.select).toEqual([
{ aggFn: 'max', valueExpression: 'Duration' },
{
aggFn: 'quantile',
level: 0.95,
valueExpression: 'Duration',
aggCondition: "ServiceName = 'api'",
aggConditionLanguage: 'sql',
},
]);
});
});
23 changes: 13 additions & 10 deletions packages/api/src/controllers/ai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
TableMetadata,
tcFromSource,
} from '@hyperdx/common-utils/dist/core/metadata';
import { resolvePercentileAggFn } from '@hyperdx/common-utils/dist/core/utils';
import {
AILineTableResponse,
AssistantLineTableConfigSchema,
Expand Down Expand Up @@ -257,16 +258,18 @@ export function getChartConfigFromResolvedConfig(

return {
displayType: resObject.displayType,
select: resObject.select.map(s => ({
aggFn: s.aggregationFunction,
valueExpression: s.property,
...(s.condition
? {
aggCondition: s.condition,
aggConditionLanguage: 'sql',
}
: {}),
})),
select: resObject.select.map(s =>
resolvePercentileAggFn({
aggFn: s.aggregationFunction,
valueExpression: s.property,
...(s.condition
? {
aggCondition: s.condition,
aggConditionLanguage: 'sql',
}
: {}),
}),
),
from: {
tableName: source.from.tableName,
databaseName: source.from.databaseName,
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/routers/api/ai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Generate a visualization or search that matches their request. The chart should

Here are some guidelines:
- Use appropriate display types: 'line' for time series, 'table' for tabular data
- Use appropriate aggregate functions depending on user's request: 'count', 'sum', 'avg', 'min', 'max', 'count_distinct'
- Use appropriate aggregate functions depending on user's request: 'count', 'sum', 'avg', 'min', 'max', 'count_distinct', and 'p50', 'p90', 'p95', 'p99' for percentiles
- If the user is requesting for a specific set of data (ex. "frontend service", filter the condition by the appropriate property based on the below properties ex. \`ServiceName = 'frontend'\`)
- Pick an appropriate time range based on the user's request if one can be inferred from the request.

Expand Down
14 changes: 7 additions & 7 deletions packages/app/src/ChartUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
convertToNumberChartConfig,
convertToTableChartConfig,
getAlignedDateRange,
getPercentileAggFnLevel,
Granularity,
hasPositiveSeriesLimit,
TIME_SERIES_DISPLAY_TYPE_BY_NAME,
Expand Down Expand Up @@ -1111,16 +1112,11 @@ const mapV1AggFnToV2 = (aggFn?: AggFn): AggFnV2 | undefined => {
}
// Map rate-based aggregations to their base aggregation
if (aggFn.endsWith('_rate')) {
return mapV1AggFnToV2(aggFn.replace('_rate', '') as AggFn);
return mapV1AggFnToV2(aggFn.replace(/_rate$/, '') as AggFn);
}

// Map percentiles to quantile
if (
aggFn === 'p50' ||
aggFn === 'p90' ||
aggFn === 'p95' ||
aggFn === 'p99'
) {
if (getPercentileAggFnLevel(aggFn) != null) {
return 'quantile';
}

Expand Down Expand Up @@ -1218,8 +1214,12 @@ export const convertV1ChartConfigToV2 = (
const metricDataType = z
.nativeEnum(MetricsDataTypeV2)
.parse(rawMetricDataType?.toLowerCase());
const percentileLevel = getPercentileAggFnLevel(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 minor — v1 conversion repeats the _rate stripping and percentile check that mapV1AggFnToV2 already does

Have mapV1AggFnToV2 return { aggFn, level }, or wrap its result with resolvePercentileAggFn on the _rate-stripped aggFn. Right now the call site strips _rate with its own regex and computes the level separately from the function that decides the aggFn is quantile, so the two can disagree.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 minor — v1 conversion works out the percentile level separately from the aggFn mapping

mapV1AggFnToV2 already strips _rate and maps percentiles to quantile. The new code strips _rate again with its own regex and calls getPercentileAggFnLevel a second time. Replace both with one resolvePercentileAggFn({ aggFn: s.aggFn?.replace(/_rate$/, ''), ... }) before the remaining v1→v2 mapping, so the aggFn and its level come from one call.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 minor — _rate suffix stripping is duplicated next to mapV1AggFnToV2

mapV1AggFnToV2 already strips _rate and recognises percentiles (lines 1114-1121), and the new code strips it again with a slightly different expression (/_rate$/ vs replace('_rate', '')). Have mapV1AggFnToV2 return { aggFn, level } so the conversion logic lives in one place.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 minor — The _rate suffix is stripped and the percentile looked up in two places that must be kept in sync by hand

mapV1AggFnToV2 already strips /_rate$/ and calls getPercentileAggFnLevel (lines 1107-1113). The metric branch now repeats both steps to get the level. Have mapV1AggFnToV2, or a small helper next to it, return { aggFn, level } in one pass, so the aggFn mapping and the level cannot drift apart.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 minor — Percentile level is derived separately from mapV1AggFnToV2, duplicating the _rate stripping

mapV1AggFnToV2 already strips _rate and detects percentiles. The call site repeats both (s.aggFn?.replace(/_rate$/, '') plus getPercentileAggFnLevel) to get the level, so the two must be kept in sync by hand. Fix: strip _rate once and build the item with resolvePercentileAggFn({ aggFn: base, ... }), or have the mapper return { aggFn, level }, so the aggFn and its level come from one place.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 minor — The v1 conversion strips _rate and checks for a percentile twice to get aggFn and level

mapV1AggFnToV2 already strips _rate and calls getPercentileAggFnLevel. The new code at lines 1217-1219 does both again separately to recover the level. Have mapV1AggFnToV2 return { aggFn, level? }, or run resolvePercentileAggFn on the mapped item, so the rate-suffix and percentile logic lives in one place.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 minor — The _rate suffix is stripped in two places to work out one percentile

mapV1AggFnToV2 already strips _rate and checks for a percentile. The caller now strips _rate again and runs a second getPercentileAggFnLevel lookup, so the aggFn and the level come from two parallel code paths that have to be kept in sync. Instead, have mapV1AggFnToV2 return { aggFn, level? }. Or let it return the base aggFn (for example p95) and pass the select item through resolvePercentileAggFn. Either way, the percentile is resolved in one place.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

s.aggFn?.replace(/_rate$/, ''),
);
return {
aggFn: mapV1AggFnToV2(s.aggFn),
...(percentileLevel != null ? { level: percentileLevel } : {}),
metricType: metricDataType,
valueExpression: field,
metricName,
Expand Down
54 changes: 54 additions & 0 deletions packages/app/src/__tests__/ChartUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
convertToReducedPromqlChartConfig,
convertToTableChartConfig,
convertToTimeChartConfig,
convertV1ChartConfigToV2,
findNearestSeriesKey,
formatResponseForCategoricalChart,
formatResponseForTimeChart,
Expand Down Expand Up @@ -1878,3 +1879,56 @@ describe('getSeriesColorForGroup', () => {
expect(getSeriesColorForGroup(lineData, 'api')).toBe('#solid');
});
});

describe('convertV1ChartConfigToV2', () => {
const metricSource = {
id: 'metric-source',
kind: SourceKind.Metric,
connection: 'connection-id',
from: { databaseName: 'default', tableName: '' },
timestampValueExpression: 'TimeUnix',
resourceAttributesExpression: 'ResourceAttributes',
metricTables: {
gauge: 'otel_metrics_gauge',
histogram: 'otel_metrics_histogram',
sum: 'otel_metrics_sum',
},
} as unknown as Parameters<typeof convertV1ChartConfigToV2>[1]['metric'];

const convertMetricSeries = (aggFn: 'p95' | 'p99_rate' | 'avg') =>
convertV1ChartConfigToV2(
{
series: [
{
type: 'time',
table: 'metrics',
aggFn,
field: 'http.server.duration - Gauge',
where: '',
groupBy: [],
},
],
dateRange: [new Date('2025-02-12'), new Date('2025-02-14')],
seriesReturnType: 'column',
},
{ metric: metricSource },
).select;

it('converts a percentile to quantile with its level', () => {
expect(convertMetricSeries('p95')).toEqual([
expect.objectContaining({ aggFn: 'quantile', level: 0.95 }),
]);
});

it('converts a percentile rate to quantile with its level', () => {
expect(convertMetricSeries('p99_rate')).toEqual([
expect.objectContaining({ aggFn: 'quantile', level: 0.99 }),
]);
});

it('sets no level for other aggregations', () => {
const [select] = convertMetricSeries('avg');
expect(select).toEqual(expect.objectContaining({ aggFn: 'avg' }));
expect(select).not.toHaveProperty('level');
});
});
9 changes: 4 additions & 5 deletions packages/app/src/components/AggFnSelect.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useCallback, useMemo } from 'react';
import { useController, UseControllerProps } from 'react-hook-form';
import { getPercentileAggFnLevel } from '@hyperdx/common-utils/dist/core/utils';
import { MetricsDataType } from '@hyperdx/common-utils/dist/types';
import { Select } from '@mantine/core';

Expand Down Expand Up @@ -64,13 +65,11 @@ function AggFnSelect({
}) {
const _onChange = useCallback(
(value: string | null) => {
const percentileLevel = getPercentileAggFnLevel(value ?? undefined);
if (value == null) {
onChange({});
} else if (['p50', 'p90', 'p95', 'p99'].includes(value)) {
onChange({
aggFn: 'quantile',
level: Number.parseFloat(value.replace('p', '0.')),
});
} else if (percentileLevel != null) {
onChange({ aggFn: 'quantile', level: percentileLevel });
} else {
// @ts-expect-error Mantine Select passes a string; onChange expects a narrowed AggFn union
onChange({ aggFn: value });
Expand Down
60 changes: 60 additions & 0 deletions packages/common-utils/src/__tests__/renderChartConfig.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3712,6 +3712,66 @@ describe('renderChartConfig', () => {
expect(sql).toContain("hasToken(lower(Body), lower('denied'))");
});

describe('percentile shorthand aggFn', () => {
const baseTraceConfig: ChartConfigWithOptDateRange = {
displayType: DisplayType.Table,
connection: 'test-connection',
from: {
databaseName: 'default',
tableName: 'otel_traces',
},
select: [],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 minor — New percentile render tests never use a metric source, though that path depends on the rewrite running first

Both new tests use a trace table. The rewrite is placed before the multi-series metric branch and translateMetricChartConfig because histogram translation branches on select.aggFn === 'quantile' (packages/common-utils/src/core/histogram.ts:75). Moving the rewrite after metric translation would still pass every new test. Add a case for a histogram metric with aggFn: 'p95', and one for a multi-series metric with aggFn: 'p95', that assert the quantile SQL at level 0.95.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

where: '',
whereLanguage: 'sql',
timestampValueExpression: 'Timestamp',
dateRange: [new Date('2025-02-12'), new Date('2025-02-14')],
};

it('renders p95 as quantile at level 0.95', async () => {
const config: ChartConfigWithOptDateRange = {
...baseTraceConfig,
select: [
{
aggFn: 'p95',
valueExpression: 'Duration',
aggCondition: "ServiceName = 'api'",
aggConditionLanguage: 'sql',
},
],
};

const actual = parameterizedQueryToSql(
await renderChartConfig(config, mockMetadata, querySettings),
);
expect(actual).toContain(
'quantileIf(0.95)(toFloat64OrDefault(toString(Duration))',
);
expect(actual).not.toContain('p95');
});

it('renders p99 as sample-weighted quantile at level 0.99', async () => {
const config: ChartConfigWithOptDateRange = {
...baseTraceConfig,
sampleWeightExpression: 'SampleRate',
select: [
{
aggFn: 'p99',
valueExpression: 'Duration',
aggCondition: '',
},
],
};

const actual = parameterizedQueryToSql(
await renderChartConfig(config, mockMetadata, querySettings),
);
expect(actual).toContain(
'quantileTDigestWeighted(0.99)(toFloat64OrDefault(toString(Duration))',
);
expect(actual).not.toContain('p99');
});
});

describe('sample-weighted aggregations', () => {
const baseSampledConfig: ChartConfigWithOptDateRange = {
displayType: DisplayType.Table,
Expand Down
42 changes: 42 additions & 0 deletions packages/common-utils/src/__tests__/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
getAlignedDateRange,
getDistributedTableArgs,
getFirstOrderingItem,
getPercentileAggFnLevel,
hasNonEmptyOrderBy,
hasPositiveSeriesLimit,
isFirstOrderByAscending,
Expand All @@ -25,6 +26,7 @@ import {
parseToStartOfFunction,
pickBucketTimestampColumn,
replaceJsonExpressions,
resolvePercentileAggFn,
splitAndTrimCSV,
splitAndTrimWithBracket,
} from '@/core/utils';
Expand Down Expand Up @@ -3500,4 +3502,44 @@ describe('utils', () => {
).toBe('30 second');
});
});

describe('getPercentileAggFnLevel', () => {
it.each([
['p50', 0.5],
['p90', 0.9],
['p95', 0.95],
['p99', 0.99],
])('returns the level of %s', (aggFn, level) => {
expect(getPercentileAggFnLevel(aggFn)).toBe(level);
});

it.each(['quantile', 'avg', 'p75', 'toString', undefined])(
'returns undefined for %s',
aggFn => {
expect(getPercentileAggFnLevel(aggFn)).toBeUndefined();
},
);
});

describe('resolvePercentileAggFn', () => {
it('rewrites a percentile shorthand as quantile with its level', () => {
expect(
resolvePercentileAggFn({
aggFn: 'p95',
valueExpression: 'Duration',
aggCondition: "ServiceName = 'api'",
}),
).toEqual({
aggFn: 'quantile',
level: 0.95,
valueExpression: 'Duration',
aggCondition: "ServiceName = 'api'",
});
});

it('returns other select items unchanged', () => {
const select = { aggFn: 'quantile', level: 0.5, valueExpression: 'x' };
expect(resolvePercentileAggFn(select)).toBe(select);
});
});
});
14 changes: 13 additions & 1 deletion packages/common-utils/src/core/renderChartConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
optimizeTimestampValueExpression,
parseToStartOfFunction,
pickBucketTimestampColumn,
resolvePercentileAggFn,
splitAndTrimWithBracket,
} from '@/core/utils';
import { isPromqlChartConfig, isRawSqlChartConfig } from '@/guards';
Expand Down Expand Up @@ -3276,7 +3277,18 @@ export async function renderChartConfig(

// Expand dashboard variables before anything reads the config's expressions,
// so metric translation and the CTEs it builds all see final SQL fragments.
const substitutedChartConfig = substituteChartConfigVariables(rawChartConfig);
const variableSubstitutedChartConfig =
substituteChartConfigVariables(rawChartConfig);
const substitutedChartConfig = Array.isArray(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 minor — Percentiles are only resolved inside renderChartConfig, so the materialized-view optimizer still rejects saved p95 configs

tryOptimizeConfigWithMaterializedView runs on the raw config before renderChartConfig. There, isValidAggFn('p95') fails and convertSelectToMaterializedViewSelect throws "Aggregate function p95 is not valid" (packages/common-utils/src/core/materializedViews.ts:402). A saved config with aggFn: 'p95' therefore skips an MV that has a quantile column and shows a misleading reason. Fix: also apply resolvePercentileAggFn to the select list at the start of the MV optimizer (or in a shared normalization step both paths call), not only in the renderer.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 minor — Percentile shorthand is resolved only inside renderChartConfig, so the materialized-view optimizer still rejects p95

tryOptimizeConfigWithMaterializedView runs on the config before renderChartConfig. Its convertSelectToMaterializedViewSelect throws Aggregate function p95 is not valid because of the isValidAggFn check in packages/common-utils/src/core/materializedViews.ts:402. As a result, a saved aggFn: 'p95' tile never uses a quantile MV column and falls back to the raw table. Apply resolvePercentileAggFn to the select list in the MV optimizer as well, or in a shared normalization step that both paths call, so the two paths agree.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 minor — Percentile rewrite runs only inside renderChartConfig, so the MV optimizer still gets the raw p95 and rejects it

tryOptimizeConfigWithMaterializedViewWithExplanations runs on the config before renderChartConfig is called. Its callers are packages/api/src/tasks/checkAlerts/index.ts:1194 and packages/app/src/hooks/useMVOptimizationExplanation.tsx:55. When it sees aggFn: 'p95', isValidAggFn fails and it throws Aggregate function p95 is not valid (packages/common-utils/src/core/materializedViews.ts:402). As a result a p95 tile never uses an MV quantile(0.95) column, and the MV explanation shows a misleading error. Fix: apply resolvePercentileAggFn at a shared normalization point that both the MV optimizer and the renderer go through, or call it at the start of tryOptimizeConfigWithMaterializedViewWithExplanations as well.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 minor — Percentile aggFns are only resolved inside renderChartConfig, so materialized-view optimization still rejects p95 configs

The app calls tryOptimizeConfigWithMaterializedView on the config before it reaches renderChartConfig. There, convertSelectToMaterializedViewSelect (packages/common-utils/src/core/materializedViews.ts:402) throws Aggregate function p95 is not valid because p95 isn't in InternalAggregateFunctionSchema. A saved aggFn: 'p95' config now renders correctly, but it always skips the MV and reports that error as the explanation, even when the MV has a matching quantile column. Fix: also apply resolvePercentileAggFn to config.select at the start of tryOptimizeConfigWithMaterializedViewWithExplanations, or normalize where configs are loaded, so every consumer sees quantile + level.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 minor — Percentile shorthand is resolved only inside the SQL renderer, so consumers that run before it still see p95

tryOptimizeConfigWithMaterializedView runs before renderChartConfig. It only accepts aggFn === 'quantile' with a numeric level (isQuantileSelectItem), and isValidAggFn rejects p95 (both in packages/common-utils/src/core/materializedViews.ts:275-291). So a p95 select item never uses a quantile MV, and the editor keeps storing p95. Normalize where the config enters the system instead, for example a Zod preprocess on the select item schema, or when the config is loaded or saved. That way every consumer sees quantile and a level, not just the renderer.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

variableSubstitutedChartConfig.select,
)
? {
...variableSubstitutedChartConfig,
select: variableSubstitutedChartConfig.select.map(
resolvePercentileAggFn,
),
}
: variableSubstitutedChartConfig;

// A metric chart with multiple series composes one query per series into a
// single UNION ALL + pivot statement (each metric type needs its own CTE
Expand Down
Loading
Loading