Skip to content

The negative number could insert into bitmap mv without error. #4431

@EmmyMiao87

Description

@EmmyMiao87

Describe the bug
If user insert negative number into bitmap mv, Doris will not thrown exception and load null.

To Reproduce
Steps to reproduce the behavior:

  1. create table
CREATE TABLE `test` (
  `k1` int(11) NULL COMMENT "",
  `k2` bigint(20) NULL COMMENT "",
  `k3` decimal(9, 0) NULL COMMENT ""
) ENGINE=OLAP
DUPLICATE KEY(`k1`, `k2`)
COMMENT "OLAP"
DISTRIBUTED BY HASH(`k1`) BUCKETS 10
PROPERTIES (
"replication_num" = "1",
"in_memory" = "false",
"storage_format" = "DEFAULT"
);
  1. create materialized view
create materialized view mv as select k1, bitmap_union(to_bitmap(k2)) from test group by k1;
  1. insert into
insert into test values(1, -1, 1.0)

Load successfully while the to_bitmap(k2) is null.

Expected behavior
thrown exception
The input: -1 is not valid, to_bitmap only support bigint value from 0 to 18446744073709551615 currently

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions