summaryrefslogtreecommitdiff
path: root/redis/commands/bf/commands.py
diff options
context:
space:
mode:
Diffstat (limited to 'redis/commands/bf/commands.py')
-rw-r--r--redis/commands/bf/commands.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/redis/commands/bf/commands.py b/redis/commands/bf/commands.py
index 7d36b93..84a6b5f 100644
--- a/redis/commands/bf/commands.py
+++ b/redis/commands/bf/commands.py
@@ -49,6 +49,7 @@ TDIGEST_QUANTILE = "TDIGEST.QUANTILE"
TDIGEST_MIN = "TDIGEST.MIN"
TDIGEST_MAX = "TDIGEST.MAX"
TDIGEST_INFO = "TDIGEST.INFO"
+TDIGEST_MERGESTORE = "TDIGEST.MERGESTORE"
class BFCommands:
@@ -344,7 +345,7 @@ class TOPKCommands:
class TDigestCommands:
- def create(self, key, compression):
+ def create(self, key, compression=100):
"""
Allocate the memory and initialize the t-digest.
For more information see `TDIGEST.CREATE <https://redis.io/commands/tdigest.create>`_.
@@ -417,6 +418,19 @@ class TDigestCommands:
""" # noqa
return self.execute_command(TDIGEST_INFO, key)
+ def mergestore(self, dest_key, numkeys, *sourcekeys, compression=False):
+ """
+ Merges all of the values from `sourcekeys` keys to `dest_key` sketch.
+ If destination already exists, it is overwritten.
+
+
+ For more information see `TDIGEST.MERGESTORE <https://redis.io/commands/tdigest.mergestore>`_.
+ """ # noqa
+ params = [dest_key, numkeys, *sourcekeys]
+ if compression:
+ params.extend(["COMPRESSION", compression])
+ return self.execute_command(TDIGEST_MERGESTORE, *params)
+
class CMSCommands:
"""Count-Min Sketch Commands"""