BINARY_QUANTIZE

Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API

Encodes each array element into a single bit, compressing the vector by approximately 32x.

  • <array>: The vector to quantize (array(real) or array(double-precision)).

Returns a bytea value where each bit represents whether the corresponding array element is greater than 0 (1) or not (0).

  • Elements greater than 0 are encoded as 1, all others (including 0 and negative values) as 0.
  • The compression ratio is approximately 32x.

Convert a numeric vector to binary representation.

Returns '0011', where negative values become 0 and positive values become 1.