htyoung opened a new issue, #23566:
URL: https://github.com/apache/doris/issues/23566

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Version
   
   version: 2.0.1-rc03
   
   ### What's Wrong?
   
   When I delete some record from the table which has bloom filter, then I 
execute sql ```select count(*) from xxx where xxx```, it will get wrong result
   
   ### What You Expected?
   
   It return right result
   
   ### How to Reproduce?
   
   CREATE TABLE `test2` (
     `create_time` datetime NOT NULL COMMENT '',
     `vid` varchar(64) NOT NULL COMMENT '',
     `report_time` datetime NULL COMMENT '',
     `block_version` int(11) NULL COMMENT '',
     `vehicle_mode` int(11) NULL COMMENT '',
     `usage_mode` int(11) NULL COMMENT '',
     INDEX vid_bitmap_index (`vid`) USING BITMAP COMMENT '为vid添加位图索引'
   ) ENGINE=OLAP
   UNIQUE KEY(`create_time`, `vid`, `report_time`)
   COMMENT 'OLAP'
   PARTITION BY RANGE(`create_time`)
   (PARTITION p20230820 VALUES [('2023-08-20 00:00:00'), ('2023-08-21 
00:00:00')),
   PARTITION p20230821 VALUES [('2023-08-21 00:00:00'), ('2023-08-22 
00:00:00')),
   PARTITION p20230822 VALUES [('2023-08-22 00:00:00'), ('2023-08-23 
00:00:00')),
   PARTITION p20230823 VALUES [('2023-08-23 00:00:00'), ('2023-08-24 
00:00:00')),
   PARTITION p20230824 VALUES [('2023-08-24 00:00:00'), ('2023-08-25 
00:00:00')),
   PARTITION p20230825 VALUES [('2023-08-25 00:00:00'), ('2023-08-26 
00:00:00')),
   PARTITION p20230826 VALUES [('2023-08-26 00:00:00'), ('2023-08-27 
00:00:00')),
   PARTITION p20230827 VALUES [('2023-08-27 00:00:00'), ('2023-08-28 
00:00:00')),
   PARTITION p20230828 VALUES [('2023-08-28 00:00:00'), ('2023-08-29 
00:00:00')),
   PARTITION p20230829 VALUES [('2023-08-29 00:00:00'), ('2023-08-30 
00:00:00')))
   DISTRIBUTED BY HASH(`vid`) BUCKETS AUTO
   PROPERTIES (
   "replication_allocation" = "tag.location.default: 1",
   "bloom_filter_columns" = "vid",
   "is_being_synced" = "false",
   "dynamic_partition.enable" = "true",
   "dynamic_partition.time_unit" = "DAY",
   "dynamic_partition.time_zone" = "Asia/Shanghai",
   "dynamic_partition.start" = "-30",
   "dynamic_partition.end" = "1",
   "dynamic_partition.prefix" = "p",
   "dynamic_partition.replication_allocation" = "tag.location.default: 1",
   "dynamic_partition.buckets" = "10",
   "dynamic_partition.create_history_partition" = "true",
   "dynamic_partition.history_partition_num" = "-1",
   "dynamic_partition.hot_partition_num" = "0",
   "dynamic_partition.reserved_history_periods" = "NULL",
   "dynamic_partition.storage_policy" = "",
   "storage_format" = "V2",
   "light_schema_change" = "true",
   "disable_auto_compaction" = "false",
   "enable_single_replica_compaction" = "false"
   );
   
   
   insert into 
test2(create_time,vid,report_time,block_version,vehicle_mode,usage_mode) 
values('2023-08-25 10:00:00','123','2023-08-25 10:00:00',1,1,1);
   insert into 
test2(create_time,vid,report_time,block_version,vehicle_mode,usage_mode) 
values('2023-08-25 11:00:00','123','2023-08-25 11:00:00',2,2,2);
   insert into 
test2(create_time,vid,report_time,block_version,vehicle_mode,usage_mode) 
values('2023-08-25 12:00:00','123','2023-08-25 12:00:00',3,3,3);
   
   
   delete from test2 where vid="123" and report_time="2023-08-25 12:00:00" and 
create_time="2023-08-25 12:00:00";
   
   
   select count(*) from vehicle_mode_history2;  -- result is 2
   select count(*) from vehicle_mode_history2 where vid='123';  -- but this 
result is 3, exepected 2
   select count(*) from vehicle_mode_history2 where create_time>='2023-08-25 
10:00:00'; -- result is 2
   select count(CASE when vid='123' then 1 else null end) from 
vehicle_mode_history2 where vid='123'; -- reuslt is 2
   select * from vehicle_mode_history2 where vid='123'; -- result has 2 records
   
   In above sqls, the second sql expected result is 2, but it return 3;
   
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to