Skip to main content
Skip to main content

quantilesBFloat16Weighted

quantilesBFloat16Weighted

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)

Parameters

  • level — Levels of quantiles. One or more constant floating-point numbers from 0 to 1. We recommend using level values in the range of [0.01, 0.99]. Float*

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]                                               │
└───────────────────────────────────────────────────────┘