zclllyybb commented on code in PR #31434:
URL: https://github.com/apache/doris/pull/31434#discussion_r1503336446


##########
be/src/vec/exec/vanalytic_eval_node.cpp:
##########
@@ -610,7 +612,7 @@ bool VAnalyticEvalNode::_init_next_partition(BlockRowPos 
found_partition_end) {
         _partition_by_start = _partition_by_end;
         _partition_by_end = found_partition_end;
         _current_row_position = _partition_by_start.pos;
-        static_cast<void>(_reset_agg_status());
+        THROW_IF_ERROR(_reset_agg_status());

Review Comment:
   This function only returns OK, isn't it?



##########
be/src/vec/exec/vanalytic_eval_node.cpp:
##########
@@ -203,15 +203,17 @@ Status VAnalyticEvalNode::prepare(RuntimeState* state) {
     }
     _fn_place_ptr = 
_agg_arena_pool->aligned_alloc(_total_size_of_aggregate_states,
                                                    _align_aggregate_states);
-    RETURN_IF_CATCH_EXCEPTION(static_cast<void>(_create_agg_status()));
-    _executor.insert_result =
-            std::bind<void>(&VAnalyticEvalNode::_insert_result_info, this, 
std::placeholders::_1);
-    _executor.execute =
-            std::bind<void>(&VAnalyticEvalNode::_execute_for_win_func, this, 
std::placeholders::_1,
-                            std::placeholders::_2, std::placeholders::_3, 
std::placeholders::_4);
+    RETURN_IF_CATCH_EXCEPTION(THROW_IF_ERROR(_create_agg_status()));
+    _executor.insert_result = [this](auto&& PH1) {

Review Comment:
   for bind to lambda, could you use the concrete type, but not `auto` for 
parameters?



##########
be/src/vec/functions/function_totype.h:
##########
@@ -18,6 +18,7 @@
 #pragma once
 #include <fmt/format.h>
 
+#include "common/status.h"

Review Comment:
   for what?



##########
be/src/index-tools/index_tool.cpp:
##########
@@ -265,7 +265,7 @@ int main(int argc, char** argv) {
                 std::vector<FileInfo> files;
                 bool exists = false;
                 std::filesystem::path root_dir(FLAGS_directory);
-                static_cast<void>(fs->list(root_dir, true, &files, &exists));
+                THROW_IF_ERROR(fs->list(root_dir, true, &files, &exists));

Review Comment:
   There's no try-catch be able to deal with it. please print errlog and exit



##########
be/src/vec/exec/vanalytic_eval_node.cpp:
##########
@@ -203,15 +203,17 @@ Status VAnalyticEvalNode::prepare(RuntimeState* state) {
     }
     _fn_place_ptr = 
_agg_arena_pool->aligned_alloc(_total_size_of_aggregate_states,
                                                    _align_aggregate_states);
-    RETURN_IF_CATCH_EXCEPTION(static_cast<void>(_create_agg_status()));
-    _executor.insert_result =
-            std::bind<void>(&VAnalyticEvalNode::_insert_result_info, this, 
std::placeholders::_1);
-    _executor.execute =
-            std::bind<void>(&VAnalyticEvalNode::_execute_for_win_func, this, 
std::placeholders::_1,
-                            std::placeholders::_2, std::placeholders::_3, 
std::placeholders::_4);
+    RETURN_IF_CATCH_EXCEPTION(THROW_IF_ERROR(_create_agg_status()));

Review Comment:
   why not just `RETURN_IF_ERROR`?



##########
be/src/vec/sink/writer/vfile_result_writer.cpp:
##########
@@ -306,7 +306,7 @@ Status VFileResultWriter::_send_result() {
     row_buffer.push_bigint(_written_rows_counter->value()); // total rows
     row_buffer.push_bigint(_written_data_bytes->value());   // file size
     std::string file_url;
-    static_cast<void>(_get_file_url(&file_url));
+    RETURN_IF_ERROR(_get_file_url(&file_url));

Review Comment:
   only OK



-- 
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]

Reply via email to