Closed zhongyibill closed 4 years ago
The negative integer is stored high level offset, the first offset is 0 and the last offset is -1.
I know The negative integer is stored high level offset cause this issue. I think the result return negative is wrong or the roaringbitmap is not support negative?
SQL: CREATE TABLE t1 (id integer, bitmap roaringbitmap);
INSERT INTO t1 SELECT 3,RB_BUILD(ARRAY[1,2,3]); INSERT INTO t1 SELECT 4,RB_BUILD(ARRAY[3,4,5]); INSERT INTO t1 SELECT 5,RB_BUILD(ARRAY[-3,4,5]);
select id, rb_maximum(bitmap) from t1 where id in (3,4,5); id | rb_maximum ----+------------ 3 | 3 4 | 5 5 | -3
I think it should be select id, rb_maximum(bitmap) from t1 where id in (3,4,5); id | rb_maximum ----+------------ 3 | 3 4 | 5 5 | 5