github-actions[bot] commented on code in PR #28305:
URL: https://github.com/apache/doris/pull/28305#discussion_r1424853656
##########
be/src/exprs/runtime_filter.h:
##########
@@ -231,9 +232,10 @@ class IRuntimeFilter {
~IRuntimeFilter() = default;
- static Status create(RuntimeState* state, ObjectPool* pool, const
TRuntimeFilterDesc* desc,
- const TQueryOptions* query_options, const
RuntimeFilterRole role,
- int node_id, IRuntimeFilter** res, bool
build_bf_exactly = false);
+ static Status create(RuntimeFilterParamsContext* state, ObjectPool* pool,
+ const TRuntimeFilterDesc* desc, const TQueryOptions*
query_options,
+ const RuntimeFilterRole role, int node_id,
IRuntimeFilter** res,
Review Comment:
warning: parameter 'role' is const-qualified in the function declaration;
const-qualification of parameters only has an effect in function definitions
[readability-avoid-const-params-in-decls]
```suggestion
RuntimeFilterRole role, int node_id,
IRuntimeFilter** res,
```
##########
be/src/olap/rowset/segment_v2/segment_iterator.h:
##########
@@ -361,6 +362,22 @@
return 0;
}
+ bool _is_match_predicate_and_not_remaining(
+ ColumnPredicate* pred, const std::vector<ColumnPredicate*>&
remaining_predicates) {
+ return pred->type() == PredicateType::MATCH &&
+ std::find(remaining_predicates.begin(),
remaining_predicates.end(), pred) ==
+ remaining_predicates.end();
+ }
+
+ void _delete_expr_from_conjunct_roots(const vectorized::VExprSPtr& expr,
Review Comment:
warning: method '_delete_expr_from_conjunct_roots' can be made static
[readability-convert-member-functions-to-static]
```suggestion
static void _delete_expr_from_conjunct_roots(const
vectorized::VExprSPtr& expr,
```
##########
be/src/pipeline/exec/partition_sort_sink_operator.h:
##########
@@ -105,6 +105,12 @@ class PartitionSortSinkOperatorX final : public
DataSinkOperatorX<PartitionSortS
Status open(RuntimeState* state) override;
Status sink(RuntimeState* state, vectorized::Block* in_block,
SourceState source_state) override;
+ ExchangeType get_local_exchange_type() const override {
Review Comment:
warning: method 'get_local_exchange_type' can be made static
[readability-convert-member-functions-to-static]
```suggestion
static ExchangeType get_local_exchange_type() override {
```
##########
be/src/pipeline/pipeline_x/pipeline_x_fragment_context.h:
##########
@@ -19,6 +19,7 @@
#include <gen_cpp/Types_types.h>
Review Comment:
warning: 'gen_cpp/Types_types.h' file not found [clang-diagnostic-error]
```cpp
#include <gen_cpp/Types_types.h>
^
```
##########
be/src/vec/sink/group_commit_block_sink.cpp:
##########
@@ -160,21 +179,42 @@ Status GroupCommitBlockSink::_add_block(RuntimeState*
state,
}
std::shared_ptr<vectorized::Block> output_block =
vectorized::Block::create_shared();
output_block->swap(cur_mutable_block->to_block());
+ if (!_is_block_appended && state->num_rows_load_total() +
state->num_rows_load_unselected() +
+ state->num_rows_load_filtered()
<=
+
config::group_commit_memory_rows_for_max_filter_ratio) {
+ _blocks.emplace_back(output_block);
+ } else {
+ if (!_is_block_appended) {
+ RETURN_IF_ERROR(_add_blocks());
+ }
+ RETURN_IF_ERROR(_load_block_queue->add_block(
+ output_block, _group_commit_mode !=
TGroupCommitMode::SYNC_MODE));
+ }
+ return Status::OK();
+}
+
+Status GroupCommitBlockSink::_add_blocks() {
+ DCHECK(_is_block_appended == false);
Review Comment:
warning: redundant boolean literal supplied to boolean operator
[readability-simplify-boolean-expr]
```suggestion
DCHECK(!_is_block_appended);
```
##########
be/src/olap/rowset/segment_v2/segment_iterator.cpp:
##########
@@ -1100,6 +1100,36 @@ bool SegmentIterator::_need_read_data(ColumnId cid) {
return true;
}
+bool SegmentIterator::_is_target_expr_match_predicate(const
vectorized::VExprSPtr& expr,
Review Comment:
warning: method '_is_target_expr_match_predicate' can be made static
[readability-convert-member-functions-to-static]
be/src/olap/rowset/segment_v2/segment_iterator.h:377:
```diff
- bool _is_target_expr_match_predicate(const vectorized::VExprSPtr& expr,
+ static bool _is_target_expr_match_predicate(const
vectorized::VExprSPtr& expr,
```
##########
be/src/olap/rowset/segment_v2/segment_iterator.h:
##########
@@ -361,6 +362,22 @@ class SegmentIterator : public RowwiseIterator {
return 0;
}
+ bool _is_match_predicate_and_not_remaining(
Review Comment:
warning: method '_is_match_predicate_and_not_remaining' can be made static
[readability-convert-member-functions-to-static]
```suggestion
static bool _is_match_predicate_and_not_remaining(
```
##########
be/src/pipeline/pipeline_x/dependency.h:
##########
@@ -611,14 +612,30 @@
dep->set_ready();
}
}
+
void set_dep_by_channel_id(Dependency* dep, int channel_id) {
source_dependencies[channel_id] = dep;
}
- void set_ready_for_read(int channel_id) {
+
+ void set_ready_to_read(int channel_id) {
auto* dep = source_dependencies[channel_id];
- DCHECK(dep) << channel_id << " " << (int64_t)this;
+ DCHECK(dep) << channel_id;
dep->set_ready();
}
+
+ void add_mem_usage(int channel_id, size_t delta) {
Review Comment:
warning: method 'add_mem_usage' can be made const
[readability-make-member-function-const]
```suggestion
void add_mem_usage(int channel_id, size_t delta) const {
```
##########
be/src/runtime/buffer_control_block.h:
##########
@@ -104,6 +104,12 @@ class BufferControlBlock {
}
}
+ void update_total_return_rows(int64_t rows) {
Review Comment:
warning: method 'update_total_return_rows' can be made static
[readability-convert-member-functions-to-static]
```suggestion
static void update_total_return_rows(int64_t rows) {
```
##########
be/src/pipeline/pipeline_x/dependency.h:
##########
@@ -611,14 +612,30 @@ struct LocalExchangeSharedState : public BasicSharedState
{
dep->set_ready();
}
}
+
void set_dep_by_channel_id(Dependency* dep, int channel_id) {
source_dependencies[channel_id] = dep;
}
- void set_ready_for_read(int channel_id) {
+
+ void set_ready_to_read(int channel_id) {
Review Comment:
warning: method 'set_ready_to_read' can be made static
[readability-convert-member-functions-to-static]
```suggestion
static void set_ready_to_read(int channel_id) {
```
##########
be/src/pipeline/pipeline_x/dependency.h:
##########
@@ -611,14 +612,30 @@
dep->set_ready();
}
}
+
void set_dep_by_channel_id(Dependency* dep, int channel_id) {
source_dependencies[channel_id] = dep;
}
- void set_ready_for_read(int channel_id) {
+
+ void set_ready_to_read(int channel_id) {
auto* dep = source_dependencies[channel_id];
- DCHECK(dep) << channel_id << " " << (int64_t)this;
+ DCHECK(dep) << channel_id;
dep->set_ready();
}
+
+ void add_mem_usage(int channel_id, size_t delta) {
+ mem_trackers[channel_id]->consume(delta);
+ if (mem_usage.fetch_add(delta) >
config::local_exchange_buffer_mem_limit) {
+ sink_dependency->block();
+ }
+ }
+
+ void sub_mem_usage(int channel_id, size_t delta) {
Review Comment:
warning: method 'sub_mem_usage' can be made const
[readability-make-member-function-const]
```suggestion
void sub_mem_usage(int channel_id, size_t delta) const {
```
##########
be/src/runtime/fragment_mgr.cpp:
##########
@@ -1054,23 +1074,50 @@ void FragmentMgr::cancel_instance_unlocked(const
TUniqueId& instance_id,
}
}
+void FragmentMgr::cancel_fragment(const TUniqueId& query_id, int32_t
fragment_id,
+ const PPlanFragmentCancelReason& reason,
const std::string& msg) {
+ std::unique_lock<std::mutex> state_lock(_lock);
+ return cancel_fragment_unlocked(query_id, fragment_id, reason, state_lock,
msg);
+}
+
+void FragmentMgr::cancel_fragment_unlocked(const TUniqueId& query_id, int32_t
fragment_id,
Review Comment:
warning: method 'cancel_fragment_unlocked' can be made static
[readability-convert-member-functions-to-static]
```suggestion
static void FragmentMgr::cancel_fragment_unlocked(const TUniqueId& query_id,
int32_t fragment_id,
```
--
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]