github-actions[bot] commented on code in PR #41668:
URL: https://github.com/apache/doris/pull/41668#discussion_r1795243155
##########
be/src/exec/olap_common.h:
##########
@@ -617,25 +617,30 @@ bool
ColumnValueRange<primitive_type>::convert_to_avg_range_value(
std::vector<OlapTuple>& begin_scan_keys, std::vector<OlapTuple>&
end_scan_keys,
bool& begin_include, bool& end_include, int32_t max_scan_key_num) {
if constexpr (!_is_reject_split_type) {
+ CppType min_value = get_range_min_value();
+ CppType max_value = get_range_max_value();
+ if constexpr (primitive_type == PrimitiveType::TYPE_DATE) {
+ min_value.set_type(TimeType::TIME_DATE);
+ max_value.set_type(TimeType::TIME_DATE);
+ }
+ auto empty_range_only_null = min_value > max_value;
+ if (empty_range_only_null) {
+ // Not contain null will be disposed in `convert_to_close_range`,
return eos.
+ DCHECK(contain_null());
+ }
+
auto no_split = [&]() -> bool {
begin_scan_keys.emplace_back();
begin_scan_keys.back().add_value(
cast_to_string<primitive_type,
CppType>(get_range_min_value(), scale()),
contain_null());
end_scan_keys.emplace_back();
end_scan_keys.back().add_value(
- cast_to_string<primitive_type,
CppType>(get_range_max_value(), scale()));
+ cast_to_string<primitive_type,
CppType>(get_range_max_value(), scale()),
+ empty_range_only_null ? true : false);
Review Comment:
warning: redundant boolean literal in ternary expression result
[readability-simplify-boolean-expr]
```suggestion
static_cast<bool>(empty_range_only_null));
```
--
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]