DDL:
CREATE TABLE user_tags_bitmap_test
(
tag_value
BIGINT NOT NULL COMMENT '用户标签',
hid
SMALLINT NULL COMMENT '分桶id',
user_id
BITMAP BITMAP_UNION NOT NULL
) ENGINE=OLAP
AGGREGATE KEY(tag_value
, hid
)
COMMENT 'OLAP'
DISTRIBUTED BY HASH(hid
) BUCKETS 8
INSERT INTO user_profile.user_tags_bitmap_test VALUES(1, 101%100, to_bitmap(101));
INSERT INTO user_profile.user_tags_bitmap_test VALUES(1, 201%100, to_bitmap(201));
INSERT INTO user_profile.user_tags_bitmap_test VALUES(2, 101%100, to_bitmap(101));
查询语句:
select
bitmap_to_array(orthogonal_bitmap_expr_calculate(user_id,
tag_value ,
'(1|2)'))
from
user_tags_bitmap_test
where
tag_value in (1, 2);
返回结果为空