Skip to content
ClickHouse Docs

quantilesBFloat16Weighted

Autogenerated from ClickHouse system tables

Introduced in: v21.10.0

Like quantilesBFloat16 but takes into account the weight of each value.

Computes multiple approximate quantiles of a sample consisting of bfloat16 numbers at different levels simultaneously, in a single pass.

Syntax

quantilesBFloat16Weighted(level1, level2, ...)(expr, weight)

Arguments

  • expr — Expression over the column values resulting in numeric data types, Date or DateTime. (U)Int* or Float* or Date or DateTime
  • weight — Column with weights of sequence members. Weight is a number of value occurrences. UInt*

Returned value

Array of approximate quantiles of the specified levels in the same order as the levels were specified. For Date and DateTime inputs the output format matches the input format. Array(Float64) or Array(Date) or Array(DateTime)

Examples

Computing multiple weighted bfloat16 quantiles

SELECT quantilesBFloat16Weighted(0.25, 0.5, 0.75)(number, 1) FROM numbers(10)
┌─quantilesBFloat16Weighted(0.25, 0.5, 0.75)(number, 1)─┐
│ [2,4,7]                                               │
└───────────────────────────────────────────────────────┘