topk icon indicating copy to clipboard operation
topk copied to clipboard

TOPK.PRANGE issue on range from 1 to 100

Open ancuop opened this issue 8 years ago • 1 comments

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

  1. (integer) 100
  2. (integer) 100
  3. (integer) 100
  4. (integer) 100
  5. (integer) 100 127.0.0.1:6379> TOPK.PRANGE testtop 0 100
  6. "t5"
  7. "t4"
  8. "t3"
  9. "t2"
  10. "t1" 127.0.0.1:6379> TOPK.PRANGE testtop 1 100
  11. "t5"
  12. "t4"
  13. "t3"
  14. "t2"

From source code I found that in function TopKPRange_RedisCommand, "prank" is calculated different to prank in TopKPRank_RedisCommand function.

Thanks

ancuop avatar Jun 28 '16 10:06 ancuop

Yep - looks another issue that needs squashing, thanks for reportign.

itamarhaber avatar Jun 29 '16 12:06 itamarhaber