You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "xinyiZzz (via GitHub)" <gi...@apache.org> on 2023/04/10 01:32:25 UTC

[GitHub] [doris] xinyiZzz opened a new pull request, #18503: [enhancement](exception) Column filter/replicate supports exception safety

xinyiZzz opened a new pull request, #18503:
URL: https://github.com/apache/doris/pull/18503

   # Proposed changes
   
   Issue Number: close #xxx
   
   ## Problem summary
   
   column filter/replicate supports exception safety, which will actively cancel query when an exception is thrown.
   
   ## Checklist(Required)
   
   * [ ] Does it affect the original behavior
   * [ ] Has unit tests been added
   * [ ] Has document been added or modified
   * [ ] Does it need to update dependencies
   * [ ] Is this PR support rollback (If NO, please explain WHY)
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   
   


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on a diff in pull request #18503: [enhancement](exception) Column filter/replicate supports exception safety

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on code in PR #18503:
URL: https://github.com/apache/doris/pull/18503#discussion_r1161382440


##########
be/src/vec/columns/column_vector.cpp:
##########
@@ -523,9 +517,7 @@ ColumnPtr ColumnVector<T>::permute(const IColumn::Permutation& perm, size_t limi
 template <typename T>
 ColumnPtr ColumnVector<T>::replicate(const IColumn::Offsets& offsets) const {
     size_t size = data.size();
-    if (size != offsets.size()) {
-        LOG(FATAL) << "Size of offsets doesn't match size of column.";
-    }
+    column_match_offsets_size(size, offsets.size());

Review Comment:
   warning: use of undeclared identifier 'column_match_offsets_size' [clang-diagnostic-error]
   ```cpp
       column_match_offsets_size(size, offsets.size());
       ^
   ```
   



##########
be/src/vec/columns/columns_common.cpp:
##########
@@ -238,9 +236,7 @@
                                                     PaddedPODArray<OT>& offsets,
                                                     const IColumn::Filter& filter) {
     const size_t size = offsets.size();
-    if (offsets.size() != filter.size()) {
-        LOG(FATAL) << "Size of filter doesn't match size of column.";
-    }
+    column_match_filter_size(size, filter.size());

Review Comment:
   warning: use of undeclared identifier 'column_match_filter_size' [clang-diagnostic-error]
   ```cpp
       column_match_filter_size(size, filter.size());
       ^
   ```
   



##########
be/src/vec/exec/join/vhash_join_node.cpp:
##########
@@ -516,9 +516,7 @@ Status HashJoinNode::pull(doris::RuntimeState* state, vectorized::Block* output_
                     *_hash_table_variants, *_process_hashtable_ctx_variants,
                     make_bool_variant(_need_null_map_for_probe),
                     make_bool_variant(_probe_ignore_null));
-        } catch (const doris::Exception& e) {
-            return Status::Error(e.code(), e.to_string());
-        }
+        })

Review Comment:
   warning: expected ';' after do/while statement [clang-diagnostic-error]
   
   ```suggestion
           });
   ```
   



##########
be/src/vec/exec/varrow_scanner.cpp:
##########
@@ -251,7 +251,7 @@ Status VArrowScanner::get_next(vectorized::Block* block, bool* eof) {
     RETURN_IF_ERROR(_cast_src_block(&_src_block));
 
     // materialize, src block => dest columns
-    return _fill_dest_block(block, eof);
+    return RETURN_IF_CATCH_EXCEPTION(_fill_dest_block(block, eof));

Review Comment:
   warning: expected expression [clang-diagnostic-error]
   ```cpp
       return RETURN_IF_CATCH_EXCEPTION(_fill_dest_block(block, eof));
              ^
   ```
   **be/src/runtime/thread_context.h:315:** expanded from macro 'RETURN_IF_CATCH_EXCEPTION'
   ```cpp
       do {                                                                                       \
       ^
   ```
   



##########
be/src/vec/exec/join/vnested_loop_join_node.cpp:
##########
@@ -587,10 +589,11 @@
             const IColumn::Filter& filter =
                     assert_cast<const doris::vectorized::ColumnVector<UInt8>&>(*filter_column)
                             .get_data();
-            _do_filtering_and_update_visited_flags_impl<decltype(filter), SetBuildSideFlag,
-                                                        SetProbeSideFlag>(
-                    block, column_to_keep, build_block_idx, processed_blocks_num, materialize,
-                    filter);
+            RETURN_IF_CATCH_EXCEPTION(
+                    _do_filtering_and_update_visited_flags_impl<decltype(filter), SetBuildSideFlag,

Review Comment:
   warning: too many arguments provided to function-like macro invocation [clang-diagnostic-error]
   ```cpp
                       _do_filtering_and_update_visited_flags_impl<decltype(filter), SetBuildSideFlag,
                                                                                     ^
   ```
   **be/src/runtime/thread_context.h:314:** macro 'RETURN_IF_CATCH_EXCEPTION' defined here
   ```cpp
   #define RETURN_IF_CATCH_EXCEPTION(stmt)                                                        \
           ^
   ```
   



##########
be/src/vec/exprs/vexpr_context.cpp:
##########
@@ -38,12 +38,10 @@ VExprContext::~VExprContext() {
 
 doris::Status VExprContext::execute(doris::vectorized::Block* block, int* result_column_id) {
     Status st;
-    try {
+    RETURN_IF_CATCH_EXCEPTION({
         st = _root->execute(this, block, result_column_id);
         _last_result_column_id = *result_column_id;
-    } catch (const doris::Exception& e) {
-        st = Status::Error(e.code(), e.to_string());
-    }
+    })

Review Comment:
   warning: expected ';' after do/while statement [clang-diagnostic-error]
   
   ```suggestion
       });
   ```
   



##########
be/src/vec/core/block.h:
##########
@@ -132,7 +132,8 @@ class Block {
             raw_res_ptr = col_ptr_nullable->get_nested_column_ptr();
         }
 
-        return input_col_ptr->filter_by_selector(sel_rowid_idx, select_size, raw_res_ptr);
+        return RETURN_IF_CATCH_EXCEPTION(

Review Comment:
   warning: expected expression [clang-diagnostic-error]
   ```cpp
           return RETURN_IF_CATCH_EXCEPTION(
                  ^
   ```
   **be/src/runtime/thread_context.h:315:** expanded from macro 'RETURN_IF_CATCH_EXCEPTION'
   ```cpp
       do {                                                                                       \
       ^
   ```
   



##########
be/src/vec/exec/join/vnested_loop_join_node.cpp:
##########
@@ -587,10 +589,11 @@
             const IColumn::Filter& filter =
                     assert_cast<const doris::vectorized::ColumnVector<UInt8>&>(*filter_column)
                             .get_data();
-            _do_filtering_and_update_visited_flags_impl<decltype(filter), SetBuildSideFlag,
-                                                        SetProbeSideFlag>(
-                    block, column_to_keep, build_block_idx, processed_blocks_num, materialize,
-                    filter);
+            RETURN_IF_CATCH_EXCEPTION(

Review Comment:
   warning: use of undeclared identifier 'RETURN_IF_CATCH_EXCEPTION' [clang-diagnostic-error]
   ```cpp
               RETURN_IF_CATCH_EXCEPTION(
               ^
   ```
   



##########
be/src/vec/exec/join/vnested_loop_join_node.cpp:
##########
@@ -555,10 +556,11 @@
                     filter_data[i] &= !null_map[i];
                 }
             }
-            _do_filtering_and_update_visited_flags_impl<decltype(filter), SetBuildSideFlag,
-                                                        SetProbeSideFlag>(
-                    block, column_to_keep, build_block_idx, processed_blocks_num, materialize,
-                    filter);
+            RETURN_IF_CATCH_EXCEPTION(
+                    _do_filtering_and_update_visited_flags_impl<decltype(filter), SetBuildSideFlag,

Review Comment:
   warning: too many arguments provided to function-like macro invocation [clang-diagnostic-error]
   ```cpp
                       _do_filtering_and_update_visited_flags_impl<decltype(filter), SetBuildSideFlag,
                                                                                     ^
   ```
   **be/src/runtime/thread_context.h:314:** macro 'RETURN_IF_CATCH_EXCEPTION' defined here
   ```cpp
   #define RETURN_IF_CATCH_EXCEPTION(stmt)                                                        \
           ^
   ```
   



##########
be/src/vec/columns/columns_common.cpp:
##########
@@ -158,9 +158,7 @@ void filter_arrays_impl_generic(const PaddedPODArray<T>& src_elems,
                                 PaddedPODArray<OT>* res_offsets, const IColumn::Filter& filt,
                                 ssize_t result_size_hint) {
     const size_t size = src_offsets.size();
-    if (size != filt.size()) {
-        LOG(FATAL) << "Size of filter doesn't match size of column.";
-    }
+    column_match_filter_size(size, filt.size());

Review Comment:
   warning: use of undeclared identifier 'column_match_filter_size' [clang-diagnostic-error]
   ```cpp
       column_match_filter_size(size, filt.size());
       ^
   ```
   



##########
be/src/vec/exec/join/vnested_loop_join_node.cpp:
##########
@@ -555,10 +556,11 @@ Status VNestedLoopJoinNode::_do_filtering_and_update_visited_flags(Block* block,
                     filter_data[i] &= !null_map[i];
                 }
             }
-            _do_filtering_and_update_visited_flags_impl<decltype(filter), SetBuildSideFlag,
-                                                        SetProbeSideFlag>(
-                    block, column_to_keep, build_block_idx, processed_blocks_num, materialize,
-                    filter);
+            RETURN_IF_CATCH_EXCEPTION(

Review Comment:
   warning: use of undeclared identifier 'RETURN_IF_CATCH_EXCEPTION' [clang-diagnostic-error]
   ```cpp
               RETURN_IF_CATCH_EXCEPTION(
               ^
   ```
   



-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] xinyiZzz commented on a diff in pull request #18503: [enhancement](exception) Column filter/replicate supports exception safety

Posted by "xinyiZzz (via GitHub)" <gi...@apache.org>.
xinyiZzz commented on code in PR #18503:
URL: https://github.com/apache/doris/pull/18503#discussion_r1162768703


##########
be/src/runtime/thread_context.h:
##########
@@ -312,33 +312,22 @@ class StopCheckThreadMemTrackerLimit {
     tracker->transfer_to(                               \
             size, doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker_raw())
 
-// Consider catching other memory errors, such as memset failure, etc.
-#define RETURN_IF_CATCH_BAD_ALLOC(stmt)                                                            \
-    do {                                                                                           \
-        doris::thread_context()->thread_mem_tracker_mgr->clear_exceed_mem_limit_msg();             \
-        if (doris::enable_thread_catch_bad_alloc) {                                                \
-            try {                                                                                  \
-                { stmt; }                                                                          \
-            } catch (std::bad_alloc const& e) {                                                    \
-                doris::thread_context()->thread_mem_tracker()->print_log_usage(                    \
-                        doris::thread_context()->thread_mem_tracker_mgr->exceed_mem_limit_msg());  \
-                return Status::MemoryLimitExceeded(fmt::format(                                    \
-                        "PreCatch {}, {}", e.what(),                                               \
-                        doris::thread_context()->thread_mem_tracker_mgr->exceed_mem_limit_msg())); \
-            }                                                                                      \
-        } else {                                                                                   \
-            try {                                                                                  \
-                doris::enable_thread_catch_bad_alloc = true;                                       \
-                Defer defer {[&]() { doris::enable_thread_catch_bad_alloc = false; }};             \
-                { stmt; }                                                                          \
-            } catch (std::bad_alloc const& e) {                                                    \
-                doris::thread_context()->thread_mem_tracker()->print_log_usage(                    \
-                        doris::thread_context()->thread_mem_tracker_mgr->exceed_mem_limit_msg());  \
-                return Status::MemoryLimitExceeded(fmt::format(                                    \
-                        "PreCatch {}, {}", e.what(),                                               \
-                        doris::thread_context()->thread_mem_tracker_mgr->exceed_mem_limit_msg())); \
-            }                                                                                      \
-        }                                                                                          \
+#define RETURN_IF_CATCH_EXCEPTION(stmt)                                                        \
+    do {                                                                                       \
+        try {                                                                                  \
+            doris::thread_context()->thread_mem_tracker_mgr->clear_exceed_mem_limit_msg();     \
+            enable_thread_catch_bad_alloc++;                                                   \
+            { stmt; }                                                                          \
+            enable_thread_catch_bad_alloc--;                                                   \

Review Comment:
   fixed



-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] xinyiZzz commented on pull request #18503: [enhancement](exception) Column filter/replicate supports exception safety

Posted by "xinyiZzz (via GitHub)" <gi...@apache.org>.
xinyiZzz commented on PR #18503:
URL: https://github.com/apache/doris/pull/18503#issuecomment-1503363752

   run buildall


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] yiguolei commented on a diff in pull request #18503: [enhancement](exception) Column filter/replicate supports exception safety

Posted by "yiguolei (via GitHub)" <gi...@apache.org>.
yiguolei commented on code in PR #18503:
URL: https://github.com/apache/doris/pull/18503#discussion_r1166258703


##########
be/src/vec/core/block.h:
##########
@@ -264,9 +265,11 @@ class Block {
 
     void append_block_by_selector(MutableBlock* dst, const IColumn::Selector& selector) const;
 
+    // need exception safety
     static void filter_block_internal(Block* block, const std::vector<uint32_t>& columns_to_filter,

Review Comment:
   it's better to modify this method to be exception safe, and return error status.
   then we only catch exception inside this method. The callers only need to return_if_error



-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] xinyiZzz commented on pull request #18503: [enhancement](exception) Column filter/replicate supports exception safety

Posted by "xinyiZzz (via GitHub)" <gi...@apache.org>.
xinyiZzz commented on PR #18503:
URL: https://github.com/apache/doris/pull/18503#issuecomment-1503271068

   run buildall


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] yiguolei commented on a diff in pull request #18503: [enhancement](exception) Column filter/replicate supports exception safety

Posted by "yiguolei (via GitHub)" <gi...@apache.org>.
yiguolei commented on code in PR #18503:
URL: https://github.com/apache/doris/pull/18503#discussion_r1169866699


##########
be/src/vec/core/block.cpp:
##########
@@ -738,7 +738,7 @@ Status Block::filter_block(Block* block, const std::vector<uint32_t>& columns_to
         for (size_t i = 0; i < size; ++i) {
             filter_data[i] &= !null_map[i];
         }

Review Comment:
   add [[nodiscard]]  to filter_block method to force the caller check the status. 



-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] yiguolei commented on a diff in pull request #18503: [enhancement](exception) Column filter/replicate supports exception safety

Posted by "yiguolei (via GitHub)" <gi...@apache.org>.
yiguolei commented on code in PR #18503:
URL: https://github.com/apache/doris/pull/18503#discussion_r1168068536


##########
be/src/runtime/thread_context.h:
##########
@@ -312,33 +312,22 @@ class StopCheckThreadMemTrackerLimit {
     tracker->transfer_to(                               \
             size, doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker_raw())
 
-// Consider catching other memory errors, such as memset failure, etc.
-#define RETURN_IF_CATCH_BAD_ALLOC(stmt)                                                            \
-    do {                                                                                           \
-        doris::thread_context()->thread_mem_tracker_mgr->clear_exceed_mem_limit_msg();             \
-        if (doris::enable_thread_catch_bad_alloc) {                                                \
-            try {                                                                                  \
-                { stmt; }                                                                          \
-            } catch (std::bad_alloc const& e) {                                                    \
-                doris::thread_context()->thread_mem_tracker()->print_log_usage(                    \
-                        doris::thread_context()->thread_mem_tracker_mgr->exceed_mem_limit_msg());  \
-                return Status::MemoryLimitExceeded(fmt::format(                                    \
-                        "PreCatch {}, {}", e.what(),                                               \
-                        doris::thread_context()->thread_mem_tracker_mgr->exceed_mem_limit_msg())); \
-            }                                                                                      \
-        } else {                                                                                   \
-            try {                                                                                  \
-                doris::enable_thread_catch_bad_alloc = true;                                       \
-                Defer defer {[&]() { doris::enable_thread_catch_bad_alloc = false; }};             \
-                { stmt; }                                                                          \
-            } catch (std::bad_alloc const& e) {                                                    \
-                doris::thread_context()->thread_mem_tracker()->print_log_usage(                    \
-                        doris::thread_context()->thread_mem_tracker_mgr->exceed_mem_limit_msg());  \
-                return Status::MemoryLimitExceeded(fmt::format(                                    \
-                        "PreCatch {}, {}", e.what(),                                               \
-                        doris::thread_context()->thread_mem_tracker_mgr->exceed_mem_limit_msg())); \
-            }                                                                                      \
-        }                                                                                          \
+#define RETURN_IF_CATCH_EXCEPTION(stmt)                                                        \
+    do {                                                                                       \
+        try {                                                                                  \
+            doris::thread_context()->thread_mem_tracker_mgr->clear_exceed_mem_limit_msg();     \
+            doris::enable_thread_catch_bad_alloc++;                                            \
+            Defer defer {[&]() { doris::enable_thread_catch_bad_alloc--; }};                   \

Review Comment:
   why do we need such variable "enable_thread_catch_bad_alloc" ?



-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] yiguolei commented on a diff in pull request #18503: [enhancement](exception) Column filter/replicate supports exception safety

Posted by "yiguolei (via GitHub)" <gi...@apache.org>.
yiguolei commented on code in PR #18503:
URL: https://github.com/apache/doris/pull/18503#discussion_r1166258703


##########
be/src/vec/core/block.h:
##########
@@ -264,9 +265,11 @@ class Block {
 
     void append_block_by_selector(MutableBlock* dst, const IColumn::Selector& selector) const;
 
+    // need exception safety
     static void filter_block_internal(Block* block, const std::vector<uint32_t>& columns_to_filter,

Review Comment:
   it's better to modify this method to be exception safe, and return error status.
   then we only catch exception inside this method. The callers only need to return_if_error



-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] hello-stephen commented on pull request #18503: [enhancement](exception) Column filter/replicate supports exception safety

Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #18503:
URL: https://github.com/apache/doris/pull/18503#issuecomment-1503429979

   TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 33.37 seconds
    stream load tsv:          434 seconds loaded 74807831229 Bytes, about 164 MB/s
    stream load json:         21 seconds loaded 2358488459 Bytes, about 107 MB/s
    stream load orc:          72 seconds loaded 1101869774 Bytes, about 14 MB/s
    stream load parquet:          31 seconds loaded 861443392 Bytes, about 26 MB/s
    https://doris-community-test-1308700295.cos.ap-hongkong.myqcloud.com/tmp/20230411140754_clickbench_pr_127640.html


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] yiguolei commented on a diff in pull request #18503: [enhancement](exception) Column filter/replicate supports exception safety

Posted by "yiguolei (via GitHub)" <gi...@apache.org>.
yiguolei commented on code in PR #18503:
URL: https://github.com/apache/doris/pull/18503#discussion_r1161468279


##########
be/src/runtime/thread_context.h:
##########
@@ -312,33 +312,22 @@ class StopCheckThreadMemTrackerLimit {
     tracker->transfer_to(                               \
             size, doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker_raw())
 
-// Consider catching other memory errors, such as memset failure, etc.
-#define RETURN_IF_CATCH_BAD_ALLOC(stmt)                                                            \
-    do {                                                                                           \
-        doris::thread_context()->thread_mem_tracker_mgr->clear_exceed_mem_limit_msg();             \
-        if (doris::enable_thread_catch_bad_alloc) {                                                \
-            try {                                                                                  \
-                { stmt; }                                                                          \
-            } catch (std::bad_alloc const& e) {                                                    \
-                doris::thread_context()->thread_mem_tracker()->print_log_usage(                    \
-                        doris::thread_context()->thread_mem_tracker_mgr->exceed_mem_limit_msg());  \
-                return Status::MemoryLimitExceeded(fmt::format(                                    \
-                        "PreCatch {}, {}", e.what(),                                               \
-                        doris::thread_context()->thread_mem_tracker_mgr->exceed_mem_limit_msg())); \
-            }                                                                                      \
-        } else {                                                                                   \
-            try {                                                                                  \
-                doris::enable_thread_catch_bad_alloc = true;                                       \
-                Defer defer {[&]() { doris::enable_thread_catch_bad_alloc = false; }};             \
-                { stmt; }                                                                          \
-            } catch (std::bad_alloc const& e) {                                                    \
-                doris::thread_context()->thread_mem_tracker()->print_log_usage(                    \
-                        doris::thread_context()->thread_mem_tracker_mgr->exceed_mem_limit_msg());  \
-                return Status::MemoryLimitExceeded(fmt::format(                                    \
-                        "PreCatch {}, {}", e.what(),                                               \
-                        doris::thread_context()->thread_mem_tracker_mgr->exceed_mem_limit_msg())); \
-            }                                                                                      \
-        }                                                                                          \
+#define RETURN_IF_CATCH_EXCEPTION(stmt)                                                        \
+    do {                                                                                       \
+        try {                                                                                  \
+            doris::thread_context()->thread_mem_tracker_mgr->clear_exceed_mem_limit_msg();     \
+            enable_thread_catch_bad_alloc++;                                                   \
+            { stmt; }                                                                          \
+            enable_thread_catch_bad_alloc--;                                                   \

Review Comment:
   use defer to --, if returned in line 320



-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] yiguolei merged pull request #18503: [enhancement](exception) Column filter/replicate supports exception safety

Posted by "yiguolei (via GitHub)" <gi...@apache.org>.
yiguolei merged PR #18503:
URL: https://github.com/apache/doris/pull/18503


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] yiguolei commented on a diff in pull request #18503: [enhancement](exception) Column filter/replicate supports exception safety

Posted by "yiguolei (via GitHub)" <gi...@apache.org>.
yiguolei commented on code in PR #18503:
URL: https://github.com/apache/doris/pull/18503#discussion_r1168068536


##########
be/src/runtime/thread_context.h:
##########
@@ -312,33 +312,22 @@ class StopCheckThreadMemTrackerLimit {
     tracker->transfer_to(                               \
             size, doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker_raw())
 
-// Consider catching other memory errors, such as memset failure, etc.
-#define RETURN_IF_CATCH_BAD_ALLOC(stmt)                                                            \
-    do {                                                                                           \
-        doris::thread_context()->thread_mem_tracker_mgr->clear_exceed_mem_limit_msg();             \
-        if (doris::enable_thread_catch_bad_alloc) {                                                \
-            try {                                                                                  \
-                { stmt; }                                                                          \
-            } catch (std::bad_alloc const& e) {                                                    \
-                doris::thread_context()->thread_mem_tracker()->print_log_usage(                    \
-                        doris::thread_context()->thread_mem_tracker_mgr->exceed_mem_limit_msg());  \
-                return Status::MemoryLimitExceeded(fmt::format(                                    \
-                        "PreCatch {}, {}", e.what(),                                               \
-                        doris::thread_context()->thread_mem_tracker_mgr->exceed_mem_limit_msg())); \
-            }                                                                                      \
-        } else {                                                                                   \
-            try {                                                                                  \
-                doris::enable_thread_catch_bad_alloc = true;                                       \
-                Defer defer {[&]() { doris::enable_thread_catch_bad_alloc = false; }};             \
-                { stmt; }                                                                          \
-            } catch (std::bad_alloc const& e) {                                                    \
-                doris::thread_context()->thread_mem_tracker()->print_log_usage(                    \
-                        doris::thread_context()->thread_mem_tracker_mgr->exceed_mem_limit_msg());  \
-                return Status::MemoryLimitExceeded(fmt::format(                                    \
-                        "PreCatch {}, {}", e.what(),                                               \
-                        doris::thread_context()->thread_mem_tracker_mgr->exceed_mem_limit_msg())); \
-            }                                                                                      \
-        }                                                                                          \
+#define RETURN_IF_CATCH_EXCEPTION(stmt)                                                        \
+    do {                                                                                       \
+        try {                                                                                  \
+            doris::thread_context()->thread_mem_tracker_mgr->clear_exceed_mem_limit_msg();     \
+            doris::enable_thread_catch_bad_alloc++;                                            \
+            Defer defer {[&]() { doris::enable_thread_catch_bad_alloc--; }};                   \

Review Comment:
   why do we need such variable "enable_thread_catch_bad_alloc" ?



-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on a diff in pull request #18503: [enhancement](exception) Column filter/replicate supports exception safety

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on code in PR #18503:
URL: https://github.com/apache/doris/pull/18503#discussion_r1161376738


##########
be/src/common/status.h:
##########
@@ -206,6 +206,8 @@
 E(COLUMN_STREAM_NOT_EXIST, -1716);
 E(COLUMN_VALUE_NULL, -1717);
 E(COLUMN_SEEK_ERROR, -1719);
+E(COLUMN_NO_MATCH_OFFSETS_SIZE - 1720);

Review Comment:
   warning: too few arguments provided to function-like macro invocation [clang-diagnostic-error]
   ```cpp
   E(COLUMN_NO_MATCH_OFFSETS_SIZE - 1720);
                                        ^
   ```
   **be/src/common/status.h:24:** macro 'E' defined here
   ```cpp
   #define E(name, code) static constexpr int name = code
           ^
   ```
   



##########
be/src/common/status.h:
##########
@@ -206,6 +206,8 @@ E(COLUMN_READ_STREAM, -1706);
 E(COLUMN_STREAM_NOT_EXIST, -1716);
 E(COLUMN_VALUE_NULL, -1717);
 E(COLUMN_SEEK_ERROR, -1719);
+E(COLUMN_NO_MATCH_OFFSETS_SIZE - 1720);

Review Comment:
   warning: C++ requires a type specifier for all declarations [clang-diagnostic-error]
   ```cpp
   E(COLUMN_NO_MATCH_OFFSETS_SIZE - 1720);
   ^
   ```
   



##########
be/src/common/status.h:
##########
@@ -206,6 +206,8 @@
 E(COLUMN_STREAM_NOT_EXIST, -1716);
 E(COLUMN_VALUE_NULL, -1717);
 E(COLUMN_SEEK_ERROR, -1719);
+E(COLUMN_NO_MATCH_OFFSETS_SIZE - 1720);
+E(COLUMN_NO_MATCH_FILTER_SIZE - 1721);

Review Comment:
   warning: too few arguments provided to function-like macro invocation [clang-diagnostic-error]
   ```cpp
   E(COLUMN_NO_MATCH_FILTER_SIZE - 1721);
                                       ^
   ```
   **be/src/common/status.h:24:** macro 'E' defined here
   ```cpp
   #define E(name, code) static constexpr int name = code
           ^
   ```
   



##########
be/src/runtime/thread_context.h:
##########
@@ -312,33 +312,22 @@ class StopCheckThreadMemTrackerLimit {
     tracker->transfer_to(                               \
             size, doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker_raw())
 
-// Consider catching other memory errors, such as memset failure, etc.
-#define RETURN_IF_CATCH_BAD_ALLOC(stmt)                                                            \
-    do {                                                                                           \
-        doris::thread_context()->thread_mem_tracker_mgr->clear_exceed_mem_limit_msg();             \
-        if (doris::enable_thread_catch_bad_alloc) {                                                \
-            try {                                                                                  \
-                { stmt; }                                                                          \
-            } catch (std::bad_alloc const& e) {                                                    \
-                doris::thread_context()->thread_mem_tracker()->print_log_usage(                    \
-                        doris::thread_context()->thread_mem_tracker_mgr->exceed_mem_limit_msg());  \
-                return Status::MemoryLimitExceeded(fmt::format(                                    \
-                        "PreCatch {}, {}", e.what(),                                               \
-                        doris::thread_context()->thread_mem_tracker_mgr->exceed_mem_limit_msg())); \
-            }                                                                                      \
-        } else {                                                                                   \
-            try {                                                                                  \
-                doris::enable_thread_catch_bad_alloc = true;                                       \
-                Defer defer {[&]() { doris::enable_thread_catch_bad_alloc = false; }};             \
-                { stmt; }                                                                          \
-            } catch (std::bad_alloc const& e) {                                                    \
-                doris::thread_context()->thread_mem_tracker()->print_log_usage(                    \
-                        doris::thread_context()->thread_mem_tracker_mgr->exceed_mem_limit_msg());  \
-                return Status::MemoryLimitExceeded(fmt::format(                                    \
-                        "PreCatch {}, {}", e.what(),                                               \
-                        doris::thread_context()->thread_mem_tracker_mgr->exceed_mem_limit_msg())); \
-            }                                                                                      \
-        }                                                                                          \
+#define RETURN_IF_CATCH_EXCEPTION(stmt)                                                        \

Review Comment:
   warning: macro is not used [clang-diagnostic-unused-macros]
   ```cpp
   #define RETURN_IF_CATCH_EXCEPTION(stmt)                                                        \
           ^
   ```
   



##########
be/src/vec/columns/column_array.cpp:
##########
@@ -788,8 +784,7 @@
 template <typename T>
 ColumnPtr ColumnArray::replicate_number(const IColumn::Offsets& replicate_offsets) const {
     size_t col_size = size();
-    if (col_size != replicate_offsets.size())
-        LOG(FATAL) << "Size of offsets doesn't match size of column.";
+    column_match_offsets_size(col_size, replicate_offsets.size());

Review Comment:
   warning: 'this' argument to member function 'column_match_offsets_size' has type 'const doris::vectorized::ColumnArray', but function is not marked const [clang-diagnostic-error]
   ```cpp
       column_match_offsets_size(col_size, replicate_offsets.size());
       ^
   ```
   **be/src/vec/columns/column.h:693:** 'column_match_offsets_size' declared here
   ```cpp
       void column_match_offsets_size(size_t size, size_t offsets_size) {
            ^
   ```
   



##########
be/src/vec/columns/column_array.cpp:
##########
@@ -910,8 +904,7 @@
 
 ColumnPtr ColumnArray::replicate_const(const IColumn::Offsets& replicate_offsets) const {
     size_t col_size = size();
-    if (col_size != replicate_offsets.size())
-        LOG(FATAL) << "Size of offsets doesn't match size of column.";
+    column_match_offsets_size(col_size, replicate_offsets.size());

Review Comment:
   warning: 'this' argument to member function 'column_match_offsets_size' has type 'const doris::vectorized::ColumnArray', but function is not marked const [clang-diagnostic-error]
   ```cpp
       column_match_offsets_size(col_size, replicate_offsets.size());
       ^
   ```
   **be/src/vec/columns/column.h:693:** 'column_match_offsets_size' declared here
   ```cpp
       void column_match_offsets_size(size_t size, size_t offsets_size) {
            ^
   ```
   



##########
be/src/vec/columns/column_complex.h:
##########
@@ -313,9 +313,7 @@ template <typename T>
 ColumnPtr ColumnComplexType<T>::filter(const IColumn::Filter& filt,
                                        ssize_t result_size_hint) const {
     size_t size = data.size();
-    if (size != filt.size()) {
-        LOG(FATAL) << "Size of filter doesn't match size of column.";
-    }
+    column_match_filter_size(size, filt.size());

Review Comment:
   warning: use of undeclared identifier 'column_match_filter_size' [clang-diagnostic-error]
   ```cpp
       column_match_filter_size(size, filt.size());
       ^
   ```
   



##########
be/src/vec/columns/column_const.cpp:
##########
@@ -55,30 +55,21 @@ ColumnPtr ColumnConst::remove_low_cardinality() const {
 }
 
 ColumnPtr ColumnConst::filter(const Filter& filt, ssize_t /*result_size_hint*/) const {
-    if (s != filt.size()) {
-        LOG(FATAL) << fmt::format("Size of filter ({}) doesn't match size of column ({})",
-                                  filt.size(), s);
-    }
+    column_match_filter_size(s, filt.size());

Review Comment:
   warning: 'this' argument to member function 'column_match_filter_size' has type 'const doris::vectorized::ColumnConst', but function is not marked const [clang-diagnostic-error]
   ```cpp
       column_match_filter_size(s, filt.size());
       ^
   ```
   **be/src/vec/columns/column.h:702:** 'column_match_filter_size' declared here
   ```cpp
       void column_match_filter_size(size_t size, size_t filter_size) {
            ^
   ```
   



##########
be/src/vec/columns/column_decimal.cpp:
##########
@@ -382,9 +378,7 @@
 template <typename T>
 ColumnPtr ColumnDecimal<T>::replicate(const IColumn::Offsets& offsets) const {
     size_t size = data.size();
-    if (size != offsets.size()) {
-        LOG(FATAL) << "Size of offsets doesn't match size of column.";
-    }
+    column_match_offsets_size(size, offsets.size());

Review Comment:
   warning: use of undeclared identifier 'column_match_offsets_size' [clang-diagnostic-error]
   ```cpp
       column_match_offsets_size(size, offsets.size());
       ^
   ```
   



##########
be/src/vec/columns/column_string.cpp:
##########
@@ -377,9 +377,7 @@ void ColumnString::get_permutation(bool reverse, size_t limit, int /*nan_directi
 
 ColumnPtr ColumnString::replicate(const Offsets& replicate_offsets) const {
     size_t col_size = size();
-    if (col_size != replicate_offsets.size()) {
-        LOG(FATAL) << "Size of offsets doesn't match size of column.";
-    }
+    column_match_offsets_size(col_size, replicate_offsets.size());

Review Comment:
   warning: 'this' argument to member function 'column_match_offsets_size' has type 'const doris::vectorized::ColumnString', but function is not marked const [clang-diagnostic-error]
   ```cpp
       column_match_offsets_size(col_size, replicate_offsets.size());
       ^
   ```
   **be/src/vec/columns/column.h:693:** 'column_match_offsets_size' declared here
   ```cpp
       void column_match_offsets_size(size_t size, size_t offsets_size) {
            ^
   ```
   



##########
be/src/common/status.h:
##########
@@ -206,6 +206,8 @@
 E(COLUMN_STREAM_NOT_EXIST, -1716);
 E(COLUMN_VALUE_NULL, -1717);
 E(COLUMN_SEEK_ERROR, -1719);
+E(COLUMN_NO_MATCH_OFFSETS_SIZE - 1720);
+E(COLUMN_NO_MATCH_FILTER_SIZE - 1721);

Review Comment:
   warning: C++ requires a type specifier for all declarations [clang-diagnostic-error]
   ```cpp
   E(COLUMN_NO_MATCH_FILTER_SIZE - 1721);
   ^
   ```
   



##########
be/src/vec/columns/column.h:
##########
@@ -691,6 +691,24 @@ class IColumn : public COW<IColumn> {
         }
     }
 
+    void column_match_offsets_size(size_t size, size_t offsets_size) {
+        if (size != offsets_size) {
+            throw doris::Exception(
+                    ErrorCode::COLUMN_NO_MATCH_OFFSETS_SIZE,

Review Comment:
   warning: no member named 'COLUMN_NO_MATCH_OFFSETS_SIZE' in namespace 'doris::ErrorCode' [clang-diagnostic-error]
   ```cpp
                       ErrorCode::COLUMN_NO_MATCH_OFFSETS_SIZE,
                                  ^
   ```
   



##########
be/src/vec/columns/column_array.cpp:
##########
@@ -440,7 +440,7 @@ size_t ColumnArray::filter_number(const Filter& filter) {
 
 ColumnPtr ColumnArray::filter_string(const Filter& filt, ssize_t result_size_hint) const {
     size_t col_size = get_offsets().size();
-    if (col_size != filt.size()) LOG(FATAL) << "Size of filter doesn't match size of column.";
+    column_match_filter_size(col_size, filt.size());

Review Comment:
   warning: 'this' argument to member function 'column_match_filter_size' has type 'const doris::vectorized::ColumnArray', but function is not marked const [clang-diagnostic-error]
   ```cpp
       column_match_filter_size(col_size, filt.size());
       ^
   ```
   **be/src/vec/columns/column.h:702:** 'column_match_filter_size' declared here
   ```cpp
       void column_match_filter_size(size_t size, size_t filter_size) {
            ^
   ```
   



##########
be/src/vec/columns/column.h:
##########
@@ -691,6 +691,24 @@
         }
     }
 
+    void column_match_offsets_size(size_t size, size_t offsets_size) {
+        if (size != offsets_size) {
+            throw doris::Exception(
+                    ErrorCode::COLUMN_NO_MATCH_OFFSETS_SIZE,
+                    "Size of offsets doesn't match size of column: size={}, offsets.size={}", size,
+                    offsets_size);
+        }
+    }
+
+    void column_match_filter_size(size_t size, size_t filter_size) {
+        if (size != filter_size) {
+            throw doris::Exception(
+                    ErrorCode::COLUMN_NO_MATCH_FILTER_SIZE,

Review Comment:
   warning: no member named 'COLUMN_NO_MATCH_FILTER_SIZE' in namespace 'doris::ErrorCode' [clang-diagnostic-error]
   ```cpp
                       ErrorCode::COLUMN_NO_MATCH_FILTER_SIZE,
                                  ^
   ```
   



##########
be/src/vec/columns/column_array.cpp:
##########
@@ -567,7 +565,7 @@
 
 ColumnPtr ColumnArray::filter_generic(const Filter& filt, ssize_t result_size_hint) const {
     size_t size = get_offsets().size();
-    if (size != filt.size()) LOG(FATAL) << "Size of filter doesn't match size of column.";
+    column_match_filter_size(size, filt.size());

Review Comment:
   warning: 'this' argument to member function 'column_match_filter_size' has type 'const doris::vectorized::ColumnArray', but function is not marked const [clang-diagnostic-error]
   ```cpp
       column_match_filter_size(size, filt.size());
       ^
   ```
   **be/src/vec/columns/column.h:702:** 'column_match_filter_size' declared here
   ```cpp
       void column_match_filter_size(size_t size, size_t filter_size) {
            ^
   ```
   



##########
be/src/vec/columns/column_array.cpp:
##########
@@ -944,8 +937,7 @@
 
 ColumnPtr ColumnArray::replicate_generic(const IColumn::Offsets& replicate_offsets) const {
     size_t col_size = size();
-    if (col_size != replicate_offsets.size())
-        LOG(FATAL) << "Size of offsets doesn't match size of column.";
+    column_match_offsets_size(col_size, replicate_offsets.size());

Review Comment:
   warning: 'this' argument to member function 'column_match_offsets_size' has type 'const doris::vectorized::ColumnArray', but function is not marked const [clang-diagnostic-error]
   ```cpp
       column_match_offsets_size(col_size, replicate_offsets.size());
       ^
   ```
   **be/src/vec/columns/column.h:693:** 'column_match_offsets_size' declared here
   ```cpp
       void column_match_offsets_size(size_t size, size_t offsets_size) {
            ^
   ```
   



##########
be/src/vec/columns/column_array.cpp:
##########
@@ -836,8 +831,7 @@
 
 ColumnPtr ColumnArray::replicate_string(const IColumn::Offsets& replicate_offsets) const {
     size_t col_size = size();
-    if (col_size != replicate_offsets.size())
-        LOG(FATAL) << "Size of offsets doesn't match size of column.";
+    column_match_offsets_size(col_size, replicate_offsets.size());

Review Comment:
   warning: 'this' argument to member function 'column_match_offsets_size' has type 'const doris::vectorized::ColumnArray', but function is not marked const [clang-diagnostic-error]
   ```cpp
       column_match_offsets_size(col_size, replicate_offsets.size());
       ^
   ```
   **be/src/vec/columns/column.h:693:** 'column_match_offsets_size' declared here
   ```cpp
       void column_match_offsets_size(size_t size, size_t offsets_size) {
            ^
   ```
   



##########
be/src/vec/columns/column_complex.h:
##########
@@ -340,9 +338,7 @@
 template <typename T>
 size_t ColumnComplexType<T>::filter(const IColumn::Filter& filter) {
     size_t size = data.size();
-    if (size != filter.size()) {
-        LOG(FATAL) << "Size of filter doesn't match size of column.";
-    }
+    column_match_filter_size(size, filter.size());

Review Comment:
   warning: use of undeclared identifier 'column_match_filter_size' [clang-diagnostic-error]
   ```cpp
       column_match_filter_size(size, filter.size());
       ^
   ```
   



##########
be/src/vec/columns/column_decimal.cpp:
##########
@@ -276,9 +276,7 @@ void ColumnDecimal<T>::insert_range_from(const IColumn& src, size_t start, size_
 template <typename T>
 ColumnPtr ColumnDecimal<T>::filter(const IColumn::Filter& filt, ssize_t result_size_hint) const {
     size_t size = data.size();
-    if (size != filt.size()) {
-        LOG(FATAL) << "Size of filter doesn't match size of column.";
-    }
+    column_match_filter_size(size, filt.size());

Review Comment:
   warning: use of undeclared identifier 'column_match_filter_size' [clang-diagnostic-error]
   ```cpp
       column_match_filter_size(size, filt.size());
       ^
   ```
   



##########
be/src/vec/columns/column_complex.h:
##########
@@ -391,9 +387,7 @@
 template <typename T>
 ColumnPtr ColumnComplexType<T>::replicate(const IColumn::Offsets& offsets) const {
     size_t size = data.size();
-    if (size != offsets.size()) {
-        LOG(FATAL) << "Size of offsets doesn't match size of column.";
-    }
+    column_match_offsets_size(size, offsets.size());

Review Comment:
   warning: use of undeclared identifier 'column_match_offsets_size' [clang-diagnostic-error]
   ```cpp
       column_match_offsets_size(size, offsets.size());
       ^
   ```
   



##########
be/src/vec/columns/column_const.cpp:
##########
@@ -55,30 +55,21 @@
 }
 
 ColumnPtr ColumnConst::filter(const Filter& filt, ssize_t /*result_size_hint*/) const {
-    if (s != filt.size()) {
-        LOG(FATAL) << fmt::format("Size of filter ({}) doesn't match size of column ({})",
-                                  filt.size(), s);
-    }
+    column_match_filter_size(s, filt.size());
 
     return ColumnConst::create(data, count_bytes_in_filter(filt));
 }
 
 size_t ColumnConst::filter(const Filter& filter) {
-    if (s != filter.size()) {
-        LOG(FATAL) << fmt::format("Size of filter ({}) doesn't match size of column ({})",
-                                  filter.size(), s);
-    }
+    column_match_filter_size(s, filter.size());
 
     const auto result_size = count_bytes_in_filter(filter);
     resize(result_size);
     return result_size;
 }
 
 ColumnPtr ColumnConst::replicate(const Offsets& offsets) const {
-    if (s != offsets.size()) {
-        LOG(FATAL) << fmt::format("Size of offsets ({}) doesn't match size of column ({})",
-                                  offsets.size(), s);
-    }
+    column_match_offsets_size(s, offsets.size());

Review Comment:
   warning: 'this' argument to member function 'column_match_offsets_size' has type 'const doris::vectorized::ColumnConst', but function is not marked const [clang-diagnostic-error]
   ```cpp
       column_match_offsets_size(s, offsets.size());
       ^
   ```
   **be/src/vec/columns/column.h:693:** 'column_match_offsets_size' declared here
   ```cpp
       void column_match_offsets_size(size_t size, size_t offsets_size) {
            ^
   ```
   



##########
be/src/vec/columns/column_vector.cpp:
##########
@@ -387,10 +387,7 @@ void ColumnVector<T>::insert_indices_from(const IColumn& src, const int* indices
 template <typename T>
 ColumnPtr ColumnVector<T>::filter(const IColumn::Filter& filt, ssize_t result_size_hint) const {
     size_t size = data.size();
-    if (size != filt.size()) {
-        LOG(FATAL) << "Size of filter doesn't match size of column. data size: " << size
-                   << ", filter size: " << filt.size() << get_stack_trace();
-    }
+    column_match_filter_size(size, filt.size());

Review Comment:
   warning: use of undeclared identifier 'column_match_filter_size' [clang-diagnostic-error]
   ```cpp
       column_match_filter_size(size, filt.size());
       ^
   ```
   



##########
be/src/vec/columns/column_dummy.h:
##########
@@ -108,9 +108,7 @@ class IColumnDummy : public IColumn {
     }
 
     ColumnPtr replicate(const Offsets& offsets) const override {
-        if (s != offsets.size()) {
-            LOG(FATAL) << "Size of offsets doesn't match size of column.";
-        }
+        column_match_offsets_size(s, offsets.size());

Review Comment:
   warning: 'this' argument to member function 'column_match_offsets_size' has type 'const doris::vectorized::IColumnDummy', but function is not marked const [clang-diagnostic-error]
   ```cpp
           column_match_offsets_size(s, offsets.size());
           ^
   ```
   **be/src/vec/columns/column.h:693:** 'column_match_offsets_size' declared here
   ```cpp
       void column_match_offsets_size(size_t size, size_t offsets_size) {
            ^
   ```
   



##########
be/src/vec/columns/column_vector.cpp:
##########
@@ -444,10 +441,7 @@
 template <typename T>
 size_t ColumnVector<T>::filter(const IColumn::Filter& filter) {
     size_t size = data.size();
-    if (size != filter.size()) {
-        LOG(FATAL) << "Size of filter doesn't match size of column. data size: " << size
-                   << ", filter size: " << filter.size() << get_stack_trace();
-    }
+    column_match_filter_size(size, filter.size());

Review Comment:
   warning: use of undeclared identifier 'column_match_filter_size' [clang-diagnostic-error]
   ```cpp
       column_match_filter_size(size, filter.size());
       ^
   ```
   



##########
be/src/vec/columns/column_decimal.cpp:
##########
@@ -327,9 +325,7 @@
 template <typename T>
 size_t ColumnDecimal<T>::filter(const IColumn::Filter& filter) {
     size_t size = data.size();
-    if (size != filter.size()) {
-        LOG(FATAL) << "Size of filter doesn't match size of column.";
-    }
+    column_match_filter_size(size, filter.size());

Review Comment:
   warning: use of undeclared identifier 'column_match_filter_size' [clang-diagnostic-error]
   ```cpp
       column_match_filter_size(size, filter.size());
       ^
   ```
   



-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org