This is an automated email from the ASF dual-hosted git repository. gabriellee pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push: new b8ebcdff78 [Bug](bloomfilter) Fix wrong result using bloomfilter with date type (#17225) b8ebcdff78 is described below commit b8ebcdff784b6e7f76bd298f19a67b589e17e71f Author: Gabriel <gabrielleeb...@gmail.com> AuthorDate: Wed Mar 1 12:29:20 2023 +0800 [Bug](bloomfilter) Fix wrong result using bloomfilter with date type (#17225) --- be/src/exprs/bloom_filter_func.h | 12 ++---------- .../datatype_p0/date/test_date_runtime_filter.out | 20 ++++++++++++++++++++ .../datatype_p0/date/test_date_runtime_filter.groovy | 14 ++++++++++++++ 3 files changed, 36 insertions(+), 10 deletions(-) diff --git a/be/src/exprs/bloom_filter_func.h b/be/src/exprs/bloom_filter_func.h index 3d8f565aa3..31d7192546 100644 --- a/be/src/exprs/bloom_filter_func.h +++ b/be/src/exprs/bloom_filter_func.h @@ -312,22 +312,18 @@ struct FixedStringFindOp : public StringFindOp { } }; -struct DateTimeFindOp : public CommonFindOp<DateTimeValue> { +struct DateTimeFindOp : public CommonFindOp<vectorized::VecDateTimeValue> { bool find_olap_engine(const BloomFilterAdaptor& bloom_filter, const void* data) const { vectorized::VecDateTimeValue value; value.from_olap_datetime(*reinterpret_cast<const uint64_t*>(data)); return bloom_filter.test(Slice((char*)&value, sizeof(vectorized::VecDateTimeValue))); } - - void insert(BloomFilterAdaptor& bloom_filter, const void* data) const { - bloom_filter.add_bytes((char*)data, sizeof(vectorized::VecDateTimeValue)); - } }; // avoid violating C/C++ aliasing rules. // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101684 -struct DateFindOp : public CommonFindOp<DateTimeValue> { +struct DateFindOp : public CommonFindOp<vectorized::VecDateTimeValue> { bool find_olap_engine(const BloomFilterAdaptor& bloom_filter, const void* data) const { uint24_t date = *static_cast<const uint24_t*>(data); uint64_t value = uint32_t(date); @@ -337,10 +333,6 @@ struct DateFindOp : public CommonFindOp<DateTimeValue> { return bloom_filter.test(Slice((char*)&date_value, sizeof(vectorized::VecDateTimeValue))); } - - void insert(BloomFilterAdaptor& bloom_filter, const void* data) const { - bloom_filter.add_bytes((char*)data, sizeof(vectorized::VecDateTimeValue)); - } }; struct DecimalV2FindOp : public CommonFindOp<DecimalV2Value> { diff --git a/regression-test/data/datatype_p0/date/test_date_runtime_filter.out b/regression-test/data/datatype_p0/date/test_date_runtime_filter.out index a6051c0236..c860aebfe2 100644 --- a/regression-test/data/datatype_p0/date/test_date_runtime_filter.out +++ b/regression-test/data/datatype_p0/date/test_date_runtime_filter.out @@ -24,3 +24,23 @@ 2 2000-02-02 2000-02-02T11:11:11 2 2000-02-02 2000-02-02T11:11:11 3 2000-03-02 2000-03-02T11:11:11 3 2000-03-02 2000-03-02T11:11:11 +-- !sql2 -- +1 2000-01-01 2000-01-01T11:11:11 1 2000-01-01 2000-01-01T11:11:11 +2 2000-02-02 2000-02-02T11:11:11 2 2000-02-02 2000-02-02T11:11:11 +3 2000-03-02 2000-03-02T11:11:11 3 2000-03-02 2000-03-02T11:11:11 + +-- !sql2 -- +1 2000-01-01 2000-01-01T11:11:11 1 2000-01-01 2000-01-01T11:11:11 +2 2000-02-02 2000-02-02T11:11:11 2 2000-02-02 2000-02-02T11:11:11 +3 2000-03-02 2000-03-02T11:11:11 3 2000-03-02 2000-03-02T11:11:11 + +-- !sql2 -- +1 2000-01-01 2000-01-01T11:11:11 1 2000-01-01 2000-01-01T11:11:11 +2 2000-02-02 2000-02-02T11:11:11 2 2000-02-02 2000-02-02T11:11:11 +3 2000-03-02 2000-03-02T11:11:11 3 2000-03-02 2000-03-02T11:11:11 + +-- !sql2 -- +1 2000-01-01 2000-01-01T11:11:11 1 2000-01-01 2000-01-01T11:11:11 +2 2000-02-02 2000-02-02T11:11:11 2 2000-02-02 2000-02-02T11:11:11 +3 2000-03-02 2000-03-02T11:11:11 3 2000-03-02 2000-03-02T11:11:11 + diff --git a/regression-test/suites/datatype_p0/date/test_date_runtime_filter.groovy b/regression-test/suites/datatype_p0/date/test_date_runtime_filter.groovy index f1526c1517..109c0b5e85 100644 --- a/regression-test/suites/datatype_p0/date/test_date_runtime_filter.groovy +++ b/regression-test/suites/datatype_p0/date/test_date_runtime_filter.groovy @@ -45,5 +45,19 @@ suite("test_date_runtime_filter") { sql " set runtime_filter_type = 8; " qt_sql2 "select * from ${tbName} a, ${tbName} b WHERE a.c3 = b.c3 ORDER BY a.c2" + sql " set runtime_filter_wait_time_ms = 0; " + + sql " set runtime_filter_type = 1; " + qt_sql2 "select * from ${tbName} a, ${tbName} b WHERE a.c3 = b.c3 ORDER BY a.c2" + + sql " set runtime_filter_type = 2; " + qt_sql2 "select * from ${tbName} a, ${tbName} b WHERE a.c3 = b.c3 ORDER BY a.c2" + + sql " set runtime_filter_type = 4; " + qt_sql2 "select * from ${tbName} a, ${tbName} b WHERE a.c3 = b.c3 ORDER BY a.c2" + + sql " set runtime_filter_type = 8; " + qt_sql2 "select * from ${tbName} a, ${tbName} b WHERE a.c3 = b.c3 ORDER BY a.c2" + sql "DROP TABLE ${tbName}" } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org