apache / doris

Apache Doris is an easy-to-use, high performance and unified analytics database.
https://doris.apache.org
Apache License 2.0
12.66k stars 3.27k forks source link

[Bug] Returning incorrect amount of rows when enable vectorization in some where conditions with varchar data type #11644

Closed lide-reed closed 2 years ago

lide-reed commented 2 years ago

Search before asking

Version

Doris 1.1.1 rc03

What's Wrong?

MySQL [testdb]> select count() from lide_test where create_time>='2022-05-22 11:56:00' and create_time<='2022-05-22 11:58:00'; +----------+ | count() | +----------+ | 105 | +----------+ 1 row in set (0.06 sec)

MySQL [testdb]> set enable_vectorized_engine=true; Query OK, 0 rows affected (0.00 sec)

MySQL [testdb]> select count() from lide_test where create_time>='2022-05-22 11:56:00' and create_time<='2022-05-22 11:58:00'; +----------+ | count() | +----------+ | 104 | +----------+ 1 row in set (0.07 sec)

What You Expected?

The same result between enable or disable vectorization

How to Reproduce?

  1. create table CREATE TABLE lide_test ( uid varchar(500) NULL COMMENT "", dt date NULL COMMENT "导入时间", create_time varchar(1050) NULL COMMENT "" ) ENGINE=OLAP UNIQUE KEY(uid, dt) COMMENT "OLAP" PARTITION BY RANGE(dt) (PARTITION P19700101 VALUES [('1970-01-01'), ('2022-08-08')), PARTITION P20220808 VALUES [('2022-08-08'), ('2022-08-09')), PARTITION P20220809 VALUES [('2022-08-09'), ('2022-08-10')), PARTITION P20220810 VALUES [('2022-08-10'), ('2022-08-11')), PARTITION P20220811 VALUES [('2022-08-11'), ('2022-08-12')), PARTITION P20220812 VALUES [('2022-08-12'), ('2022-08-13')), PARTITION P20220813 VALUES [('2022-08-13'), ('2022-08-14'))) DISTRIBUTED BY HASH(uid, dt) BUCKETS 8 PROPERTIES ( "replication_allocation" = "tag.location.default: 1", "in_memory" = "false", "storage_format" = "V2" );

  2. import sample data download from https://derenli-bj-1301087413.cos.ap-beijing.myqcloud.com/tmp/data.tgz

  3. query

Anything Else?

No response

Are you willing to submit PR?

Code of Conduct

dataroaring commented 2 years ago

03E5AD557AE13CE18A2A3BB836DA6793 2022-05-22 2022-05-22 11:57:54

dataroaring commented 2 years ago

select * from lide_test where create_time>='2022-05-22 11:57:54' and create_time<='2022-05-22 11:57:55';