What's Missing
MEDIAN_TDIGEST is registered as a separate aggregate function in the Databend source code, but it has no documentation page and is not mentioned as an alias in the existing QUANTILE_TDIGEST documentation.
Source File
/workspace/databend/src/query/functions/src/aggregates/aggregate_quantile_tdigest.rs
Relevant registration in /workspace/databend/src/query/functions/src/aggregates/aggregator.rs:
factory.register("quantile_tdigest", aggregate_quantile_tdigest_function_desc());
factory.register("median_tdigest", aggregate_median_tdigest_function_desc());
Both aggregate_quantile_tdigest_function_desc() and aggregate_median_tdigest_function_desc() are defined in aggregate_quantile_tdigest.rs. They use the same underlying implementation but with different type constants (QUANTILE vs MEDIAN), meaning MEDIAN_TDIGEST is a fixed-level (0.5) variant of QUANTILE_TDIGEST.
What It Does
MEDIAN_TDIGEST(<expr>) computes the median (50th percentile) of a numeric data sequence using the t-digest algorithm. It is equivalent to QUANTILE_TDIGEST(0.5)(<expr>) but takes no level parameter.
Current State of Docs
The existing doc at /docs/en/sql-reference/20-sql-functions/07-aggregate-functions/aggregate-quantile-tdigest.md documents QUANTILE_TDIGEST but does not mention MEDIAN_TDIGEST as an alias or related function.
The aggregate-median-tdigest.md doc exists and documents MEDIAN_TDIGEST as a standalone function, but does not cross-reference QUANTILE_TDIGEST or explain the relationship.
What Needs to Be Fixed
- Add an Aliases section to
aggregate-quantile-tdigest.md listing MEDIAN_TDIGEST (when called with level 0.5).
- Add a cross-reference in
aggregate-median-tdigest.md pointing to QUANTILE_TDIGEST.
Suggested Doc Location
/docs/en/sql-reference/20-sql-functions/07-aggregate-functions/aggregate-quantile-tdigest.md — add alias reference
/docs/en/sql-reference/20-sql-functions/07-aggregate-functions/aggregate-median-tdigest.md — add cross-reference
What's Missing
MEDIAN_TDIGESTis registered as a separate aggregate function in the Databend source code, but it has no documentation page and is not mentioned as an alias in the existingQUANTILE_TDIGESTdocumentation.Source File
/workspace/databend/src/query/functions/src/aggregates/aggregate_quantile_tdigest.rsRelevant registration in
/workspace/databend/src/query/functions/src/aggregates/aggregator.rs:Both
aggregate_quantile_tdigest_function_desc()andaggregate_median_tdigest_function_desc()are defined inaggregate_quantile_tdigest.rs. They use the same underlying implementation but with different type constants (QUANTILEvsMEDIAN), meaningMEDIAN_TDIGESTis a fixed-level (0.5) variant ofQUANTILE_TDIGEST.What It Does
MEDIAN_TDIGEST(<expr>)computes the median (50th percentile) of a numeric data sequence using the t-digest algorithm. It is equivalent toQUANTILE_TDIGEST(0.5)(<expr>)but takes no level parameter.Current State of Docs
The existing doc at
/docs/en/sql-reference/20-sql-functions/07-aggregate-functions/aggregate-quantile-tdigest.mddocumentsQUANTILE_TDIGESTbut does not mentionMEDIAN_TDIGESTas an alias or related function.The
aggregate-median-tdigest.mddoc exists and documentsMEDIAN_TDIGESTas a standalone function, but does not cross-referenceQUANTILE_TDIGESTor explain the relationship.What Needs to Be Fixed
aggregate-quantile-tdigest.mdlistingMEDIAN_TDIGEST(when called with level 0.5).aggregate-median-tdigest.mdpointing toQUANTILE_TDIGEST.Suggested Doc Location
/docs/en/sql-reference/20-sql-functions/07-aggregate-functions/aggregate-quantile-tdigest.md— add alias reference/docs/en/sql-reference/20-sql-functions/07-aggregate-functions/aggregate-median-tdigest.md— add cross-reference