topk
topk copied to clipboard
TOPK.ADD issue when topk overflows
I tested case when topk overflows as below:
127.0.0.1:6379> TOPK.ADD KEY 5 K1 K2 K3 K4 K5 (integer) 5 127.0.0.1:6379> TOPK.ADD KEY 5 K1 K2 K3 K4 K5 (integer) 0 127.0.0.1:6379> TOPK.ADD KEY 5 K6 K7 (integer) -2 127.0.0.1:6379> TOPK.PRANK KEY K1 K2 K3 K4 K5 K6 K7
- (integer) 50
- (nil)
- (integer) 50
- (nil)
- (integer) 50
- (integer) 100
- (integer) 100
Due to my estimation, the score of K1 to K7 now is 1, and the result of PRANK is not correct, isn't it? I think it is the issue of ADD function. Please help to review if this is a bug. Thanks