TDIGEST.MERGESTORE

Syntax
TDIGEST.MERGESTORE destination-key numkeys source-key [source-key
  ...] [COMPRESSION compression]
Available in:
Redis Stack / Bloom 2.4.0
Time complexity:
O(N*K), where N is the number of centroids and K being the number of input sketches

Merges all of the values from 'from' keys to 'destination-key' sketch.

It is mandatory to provide the number of input keys (numkeys) before passing the input keys and the other (optional) arguments.

If destination already exists, it is overwritten.

Parameters:

  • destination-key: Sketch to copy observation values to (a t-digest data structure)
  • numkeys: Number of sketch(es) to copy observation values from
  • source-key: Sketch(es) to copy observation values from (a t-digest data structure)

Optional parameters:

  • COMPRESSION: The compression parameter. 100 is a common value for normal uses. 1000 is extremely large. If no value is passed, the used compression will the maximal value among all inputs. For more information on scaling of accuracy versus the compression parameter see The t-digest: Efficient estimates of distributions.

Return

OK on success, error otherwise

Examples

redis> TDIGEST.CREATE from-sketch-1
OK
redis> TDIGEST.CREATE from-sketch-2
OK
redis> TDIGEST.ADD from-sketch-1 10.0 1.0
OK
redis> TDIGEST.ADD from-sketch-2 50.0 1.0
OK
redis> TDIGEST.MERGESTORE destination-key 2 from-sketch-1 from-sketch-2
OK