1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

Add support for T-Digest (#2214)

* wip

* close #2216 - add support for TDIGEST.MERGESTORE and make compression optional on TDIGEST.CREATE

* fix some tdigest commands, use bloom edge docker

* fix index.ts

* 2.4-RC2 (v2.4.1)

* fix some commands and tests

* clean code
This commit is contained in:
Leibale Eidelman
2022-11-01 15:45:47 -04:00
committed by GitHub
parent 1c6d74ffcb
commit be90e62360
33 changed files with 794 additions and 20 deletions

View File

@@ -0,0 +1,30 @@
import { strict as assert } from 'assert';
import testUtils, { GLOBAL } from '../../test-utils';
import { transformArguments } from './CREATE';
describe('TDIGEST.CREATE', () => {
describe('transformArguments', () => {
it('without options', () => {
assert.deepEqual(
transformArguments('key'),
['TDIGEST.CREATE', 'key']
);
});
it('with COMPRESSION', () => {
assert.deepEqual(
transformArguments('key', {
COMPRESSION: 100
}),
['TDIGEST.CREATE', 'key', 'COMPRESSION', '100']
);
});
});
testUtils.testWithClient('client.tDigest.create', async client => {
assert.equal(
await client.tDigest.create('key'),
'OK'
);
}, GLOBAL.SERVERS.OPEN);
});