You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2023/06/12 01:16:02 UTC

[doris] branch master updated: [Chore](case) fix failed on test_big_pad when enable pipeline engine #20644

This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new ab7ac31d89 [Chore](case) fix failed on test_big_pad when enable pipeline engine #20644
ab7ac31d89 is described below

commit ab7ac31d89c0fc6d4fa88fba5dd3d0c1ae9a58d2
Author: Pxl <px...@qq.com>
AuthorDate: Mon Jun 12 09:15:55 2023 +0800

    [Chore](case) fix failed on test_big_pad when enable pipeline engine #20644
---
 be/src/pipeline/task_scheduler.cpp                 | 13 +++++++--
 be/src/service/internal_service.cpp                |  5 ++--
 be/src/vec/columns/column_string.h                 |  9 +++---
 be/src/vec/functions/function_string.h             | 33 +++++++++++++++-------
 .../suites/query_p1/test_big_pad.groovy            |  5 +---
 5 files changed, 40 insertions(+), 25 deletions(-)

diff --git a/be/src/pipeline/task_scheduler.cpp b/be/src/pipeline/task_scheduler.cpp
index 335cd51a3e..831c5e2546 100644
--- a/be/src/pipeline/task_scheduler.cpp
+++ b/be/src/pipeline/task_scheduler.cpp
@@ -250,8 +250,8 @@ void TaskScheduler::_do_work(size_t index) {
         }
         task->set_task_queue(_task_queue.get());
         auto* fragment_ctx = task->fragment_context();
-        doris::signal::query_id_hi = fragment_ctx->get_query_id().hi;
-        doris::signal::query_id_lo = fragment_ctx->get_query_id().lo;
+        signal::query_id_hi = fragment_ctx->get_query_id().hi;
+        signal::query_id_lo = fragment_ctx->get_query_id().lo;
         bool canceled = fragment_ctx->is_canceled();
 
         auto check_state = task->get_state();
@@ -279,7 +279,14 @@ void TaskScheduler::_do_work(size_t index) {
         DCHECK(check_state == PipelineTaskState::RUNNABLE);
         // task exec
         bool eos = false;
-        auto status = task->execute(&eos);
+        auto status = Status::OK();
+
+        try {
+            status = task->execute(&eos);
+        } catch (const Exception& e) {
+            status = Status::Error(e.code(), e.to_string());
+        }
+
         task->set_previous_core_id(index);
         if (!status.ok()) {
             LOG(WARNING) << fmt::format("Pipeline task [{}] failed: {}", task->debug_string(),
diff --git a/be/src/service/internal_service.cpp b/be/src/service/internal_service.cpp
index 971302b810..502d897a76 100644
--- a/be/src/service/internal_service.cpp
+++ b/be/src/service/internal_service.cpp
@@ -147,9 +147,8 @@ class NewHttpClosure : public ::google::protobuf::Closure {
 public:
     NewHttpClosure(google::protobuf::Closure* done) : _done(done) {}
     NewHttpClosure(T* request, google::protobuf::Closure* done) : _request(request), _done(done) {}
-    ~NewHttpClosure() {}
 
-    void Run() {
+    void Run() override {
         SCOPED_SWITCH_THREAD_MEM_TRACKER_LIMITER(ExecEnv::GetInstance()->orphan_mem_tracker());
         if (_request != nullptr) {
             delete _request;
@@ -285,7 +284,7 @@ void PInternalServiceImpl::exec_plan_fragment(google::protobuf::RpcController* c
             request->has_version() ? request->version() : PFragmentRequestVersion::VERSION_1;
     try {
         st = _exec_plan_fragment(request->request(), version, compact);
-    } catch (const doris::Exception& e) {
+    } catch (const Exception& e) {
         st = Status::Error(e.code(), e.to_string());
     }
     if (!st.ok()) {
diff --git a/be/src/vec/columns/column_string.h b/be/src/vec/columns/column_string.h
index 66d0a77e5d..eb27cdc4ed 100644
--- a/be/src/vec/columns/column_string.h
+++ b/be/src/vec/columns/column_string.h
@@ -66,10 +66,9 @@ public:
 
     void static check_chars_length(size_t total_length, size_t element_number) {
         if (UNLIKELY(total_length > MAX_STRING_SIZE)) {
-            throw doris::Exception(
-                    ErrorCode::STRING_OVERFLOW_IN_VEC_ENGINE,
-                    "string column length is too large: total_length={}, element_number={}",
-                    total_length, element_number);
+            throw Exception(ErrorCode::STRING_OVERFLOW_IN_VEC_ENGINE,
+                            "string column length is too large: total_length={}, element_number={}",
+                            total_length, element_number);
         }
     }
 
@@ -137,7 +136,7 @@ public:
     }
 
     void insert(const Field& x) override {
-        const String& s = doris::vectorized::get<const String&>(x);
+        const String& s = vectorized::get<const String&>(x);
         const size_t old_size = chars.size();
         const size_t size_to_append = s.size();
         const size_t new_size = old_size + size_to_append;
diff --git a/be/src/vec/functions/function_string.h b/be/src/vec/functions/function_string.h
index 7428d19aef..ff48e01e26 100644
--- a/be/src/vec/functions/function_string.h
+++ b/be/src/vec/functions/function_string.h
@@ -60,14 +60,13 @@
 #include "vec/core/types.h"
 #include "vec/data_types/data_type.h"
 #include "vec/io/io_helper.h"
+
 #ifndef USE_LIBCPP
 #include <memory_resource>
-
 #define PMR std::pmr
 #else
 #include <boost/container/pmr/monotonic_buffer_resource.hpp>
 #include <boost/container/pmr/vector.hpp>
-
 #define PMR boost::container::pmr
 #endif
 
@@ -408,19 +407,25 @@ public:
         if (arguments.size() > 1) {
             auto& col = *block.get_by_position(arguments[1]).column;
             auto string_ref = col.get_data_at(0);
-            if (string_ref.size > 0) upper = *string_ref.data;
+            if (string_ref.size > 0) {
+                upper = *string_ref.data;
+            }
         }
 
         if (arguments.size() > 2) {
             auto& col = *block.get_by_position(arguments[2]).column;
             auto string_ref = col.get_data_at(0);
-            if (string_ref.size > 0) lower = *string_ref.data;
+            if (string_ref.size > 0) {
+                lower = *string_ref.data;
+            }
         }
 
         if (arguments.size() > 3) {
             auto& col = *block.get_by_position(arguments[3]).column;
             auto string_ref = col.get_data_at(0);
-            if (string_ref.size > 0) number = *string_ref.data;
+            if (string_ref.size > 0) {
+                number = *string_ref.data;
+            }
         }
 
         if (arguments.size() > 4) {
@@ -536,10 +541,14 @@ private:
             int len = offsets[i] - offset;
             if constexpr (Reverse) {
                 auto start = std::max(len - n, 0);
-                if (start > 0) memcpy(&res[offset], &chars[offset], start);
+                if (start > 0) {
+                    memcpy(&res[offset], &chars[offset], start);
+                }
                 offset += start;
             } else {
-                if (n < len) memcpy(&res[offset + n], &chars[offset + n], len - n);
+                if (n < len) {
+                    memcpy(&res[offset + n], &chars[offset + n], len - n);
+                }
             }
 
             len = std::min(n, len);
@@ -2179,9 +2188,13 @@ static StringRef do_money_format(FunctionContext* context, const string& value)
     }
     for (int i = value.size() - 4, j = result_len - 4; i >= 0; i = i - 3, j = j - 4) {
         *(result_data + j) = *(value.data() + i);
-        if (i - 1 < 0) break;
+        if (i - 1 < 0) {
+            break;
+        }
         *(result_data + j - 1) = *(value.data() + i - 1);
-        if (i - 2 < 0) break;
+        if (i - 2 < 0) {
+            break;
+        }
         *(result_data + j - 2) = *(value.data() + i - 2);
         if (j - 3 > 1 || (j - 3 == 1 && is_positive)) {
             *(result_data + j - 3) = ',';
@@ -2693,7 +2706,7 @@ public:
                     "character argument to convert function must be constant.");
         }
         const auto& character_data = context->get_constant_col(1)->column_ptr->get_data_at(0);
-        if (!doris::iequal(character_data.to_string(), "gbk")) {
+        if (!iequal(character_data.to_string(), "gbk")) {
             return Status::RuntimeError(
                     "Illegal second argument column of function convert. now only support "
                     "convert to character set of gbk");
diff --git a/regression-test/suites/query_p1/test_big_pad.groovy b/regression-test/suites/query_p1/test_big_pad.groovy
index ac8e1f4c2d..635881dc80 100644
--- a/regression-test/suites/query_p1/test_big_pad.groovy
+++ b/regression-test/suites/query_p1/test_big_pad.groovy
@@ -31,10 +31,7 @@ suite("test_big_pad") {
             properties("replication_num" = "1");
         """
 
-    sql "insert into d_table select 1,2000000000,1,'a';"
-    sql "insert into d_table select 1,2000000000,1,'a';"
-    sql "insert into d_table select 1,2000000000,1,'a';"
-
+    sql "insert into d_table values(1,2000000000,1,'a'),(1,2000000000,1,'a'),(1,2000000000,1,'a');"
     test {
         sql "select rpad('a',k2,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') from d_table;"
         exception "string column length is too large"


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