[fix](delete) storage engine delete do not support bitmap (#34710)

This commit is contained in:
morrySnow
2024-05-13 22:01:07 +08:00
committed by yiguolei
parent 40a1041651
commit 11175208df
3 changed files with 33 additions and 2 deletions

View File

@ -342,7 +342,8 @@ public class DeleteStmt extends DdlStmt {
// TODO(Now we can not push down non-scala type like array/map/struct to storage layer because of
// predict_column in be not support non-scala type, so we just should ban this type in delete predict, when
// we delete predict_column in be we should delete this ban)
if (!column.getType().isScalarType()) {
if (!column.getType().isScalarType()
|| (column.getType().isOnlyMetricType() && !column.getType().isJsonbType())) {
throw new AnalysisException(String.format("Can not apply delete condition to column type: %s ",
column.getType()));

View File

@ -224,7 +224,8 @@ public class DeleteFromCommand extends Command implements ForwardWithSync {
// TODO(Now we can not push down non-scala type like array/map/struct to storage layer because of
// predict_column in be not support non-scala type, so we just should ban this type in delete predict, when
// we delete predict_column in be we should delete this ban)
if (!column.getType().isScalarType()) {
if (!column.getType().isScalarType()
|| (column.getType().isOnlyMetricType() && !column.getType().isJsonbType())) {
throw new AnalysisException(String.format("Can not apply delete condition to column type: "
+ column.getType()));
}

View File

@ -483,4 +483,33 @@ suite("test_delete") {
sql "set experimental_enable_nereids_planner = false;"
sql "set @data_batch_num='2024-01-31 00:00:00';"
sql "delete from bi_acti_per_period_plan where data_batch_num =@data_batch_num; "
// delete bitmap
sql "drop table if exists table_bitmap"
sql """
CREATE TABLE if not exists `table_bitmap` (
`dt` DATE NULL,
`page_id` INT NULL,
`page_level` INT NULL,
`user_id` BITMAP NOT NULL
) ENGINE=OLAP
DUPLICATE KEY(`dt`, `page_id`, `page_level`)
COMMENT 'OLAP'
DISTRIBUTED BY HASH(`dt`) BUCKETS 10
PROPERTIES (
"replication_allocation" = "tag.location.default: 1"
);
"""
sql """
insert into table_bitmap values
('2021-12-09', 101 , 1 , BITMAP_FROM_STRING('100001,100002,100003,100004,100005')),
('2021-12-09', 102 , 2 , BITMAP_FROM_STRING('100001,100003,100004')),
('2021-12-09', 103 , 3 , BITMAP_FROM_STRING('100003'));
"""
test {
sql "delete from table_bitmap where user_id is null"
exception "Can not apply delete condition to column type: BITMAP"
}
}