HappenLee commented on code in PR #64318:
URL: https://github.com/apache/doris/pull/64318#discussion_r3425395670
##########
be/src/exec/runtime_filter/runtime_filter_partition_pruner.cpp:
##########
@@ -40,6 +44,46 @@
namespace doris {
+namespace {
+
+template <typename T>
+struct ColumnValueRangePrimitiveType;
+
+template <PrimitiveType PT>
+struct ColumnValueRangePrimitiveType<ColumnValueRange<PT>> {
+ static constexpr PrimitiveType value = PT;
+};
+
+template <typename CvrType>
+bool bloom_may_match_fixed_values(const CvrType& cvr, BloomFilterFuncBase*
bloom_filter) {
+ static constexpr PrimitiveType PT =
ColumnValueRangePrimitiveType<CvrType>::value;
+ using CppType = typename PrimitiveTypeTraits<PT>::CppType;
+ using ColumnType = typename PrimitiveTypeTraits<PT>::ColumnType;
+
+ MutableColumnPtr values_column;
+ if constexpr (IsDecimalNumber<CppType>) {
+ values_column = ColumnType::create(0, cvr.scale());
+ } else {
+ values_column = ColumnType::create();
+ }
+ auto* typed_column = assert_cast<ColumnType*>(values_column.get());
+ for (const auto& value : cvr.get_fixed_value_set()) {
+ typed_column->insert_value(value);
+ }
+ const size_t row_count = values_column->size();
Review Comment:
应该在函数开头就直接判断,如果这个是空的话,就直接不要走后面的所有逻辑。get_fixed_value_size() == 0 判断在这里太迟了
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]