topk
topk copied to clipboard
TOPK.PRANGE issue on range from 1 to 100
I made a test as below and found an issue on PRANGE command. The output when range 0 to 100 are correct however range 1 to 100 are not correct. Please help to check.
127.0.0.1:6379> TOPK.ADD testtop 5 t1 t2 t3 t4 t5 (integer) 5 127.0.0.1:6379> TOPK.PRANK testtop t1 t2 t3 t4 t5
- (integer) 100
- (integer) 100
- (integer) 100
- (integer) 100
- (integer) 100 127.0.0.1:6379> TOPK.PRANGE testtop 0 100
- "t5"
- "t4"
- "t3"
- "t2"
- "t1" 127.0.0.1:6379> TOPK.PRANGE testtop 1 100
- "t5"
- "t4"
- "t3"
- "t2"
From source code I found that in function TopKPRange_RedisCommand, "prank" is calculated different to prank in TopKPRank_RedisCommand function.
Thanks
Yep - looks another issue that needs squashing, thanks for reportign.