You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "BiteTheDDDDt (via GitHub)" <gi...@apache.org> on 2023/12/11 09:38:35 UTC

[PR] some refactor of decimal [doris]

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

   ## Proposed changes
   
   Issue Number: close #xxx
   
   <!--Describe your changes.-->
   
   ## 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


Re: [PR] test [doris]

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


##########
be/src/vec/data_types/data_type_decimal.h:
##########
@@ -21,10 +21,12 @@
 #pragma once
 #include <fmt/format.h>

Review Comment:
   warning: 'fmt/format.h' file not found [clang-diagnostic-error]
   ```cpp
   #include <fmt/format.h>
            ^
   ```
   



##########
be/src/vec/functions/function_cast.h:
##########
@@ -256,9 +256,8 @@ struct ConvertImpl {
 
     template <typename Additions = void*>
     static Status execute(FunctionContext* context, Block& block, const ColumnNumbers& arguments,

Review Comment:
   warning: function 'execute' has cognitive complexity of 101 (threshold 50) [readability-function-cognitive-complexity]
   ```cpp
       static Status execute(FunctionContext* context, Block& block, const ColumnNumbers& arguments,
                     ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/vec/functions/function_cast.h:268:** +1, including nesting penalty of 0, nesting level increased to 1
   ```cpp
           if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
           ^
   ```
   **be/src/vec/functions/function_cast.h:268:** +1
   ```cpp
           if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
                                                         ^
   ```
   **be/src/vec/functions/function_cast.h:269:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || IsTimeType<FromDataType> ||
               ^
   ```
   **be/src/vec/functions/function_cast.h:270:** +1
   ```cpp
                               IsTimeV2Type<FromDataType>) ||
                                                           ^
   ```
   **be/src/vec/functions/function_cast.h:276:** +1, including nesting penalty of 0, nesting level increased to 1
   ```cpp
           if (const ColVecFrom* col_from =
           ^
   ```
   **be/src/vec/functions/function_cast.h:282:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (IsDataTypeDecimal<FromDataType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:294:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (IsDataTypeDecimal<ToDataType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:306:** +1, nesting level increased to 2
   ```cpp
               } else {
                 ^
   ```
   **be/src/vec/functions/function_cast.h:309:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (IsDataTypeNumber<ToDataType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:313:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (std::is_integral_v<ToFieldType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:323:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:323:** +1
   ```cpp
               if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
                                                             ^
   ```
   **be/src/vec/functions/function_cast.h:324:** +1
   ```cpp
                   bool narrow_integral = context->check_overflow_for_decimal() &&
                                                                                ^
   ```
   **be/src/vec/functions/function_cast.h:328:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   if (to_scale > from_scale) {
                   ^
   ```
   **be/src/vec/functions/function_cast.h:333:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   if constexpr (IsDataTypeDecimal<FromDataType> && IsDataTypeDecimal<ToDataType>) {
                   ^
   ```
   **be/src/vec/functions/function_cast.h:333:** +1
   ```cpp
                   if constexpr (IsDataTypeDecimal<FromDataType> && IsDataTypeDecimal<ToDataType>) {
                                                                 ^
   ```
   **be/src/vec/functions/function_cast.h:337:** +1, nesting level increased to 3
   ```cpp
                   } else {
                     ^
   ```
   **be/src/vec/functions/function_cast.h:361:** +1, nesting level increased to 2
   ```cpp
               } else if constexpr (IsTimeType<FromDataType>) {
                      ^
   ```
   **be/src/vec/functions/function_cast.h:362:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   for (size_t i = 0; i < size; ++i) {
                   ^
   ```
   **be/src/vec/functions/function_cast.h:363:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                       if constexpr (IsTimeType<ToDataType>) {
                       ^
   ```
   **be/src/vec/functions/function_cast.h:365:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                           if constexpr (IsDateTimeType<ToDataType>) {
                           ^
   ```
   **be/src/vec/functions/function_cast.h:367:** +1, nesting level increased to 5
   ```cpp
                           } else {
                             ^
   ```
   **be/src/vec/functions/function_cast.h:370:** +1, nesting level increased to 4
   ```cpp
                       } else if constexpr (IsDateV2Type<ToDataType>) {
                              ^
   ```
   **be/src/vec/functions/function_cast.h:372:** +1, nesting level increased to 4
   ```cpp
                       } else if constexpr (IsDateTimeV2Type<ToDataType>) {
                              ^
   ```
   **be/src/vec/functions/function_cast.h:374:** +1, nesting level increased to 4
   ```cpp
                       } else {
                         ^
   ```
   **be/src/vec/functions/function_cast.h:379:** +1, nesting level increased to 2
   ```cpp
               } else if constexpr (IsTimeV2Type<FromDataType>) {
                      ^
   ```
   **be/src/vec/functions/function_cast.h:380:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   for (size_t i = 0; i < size; ++i) {
                   ^
   ```
   **be/src/vec/functions/function_cast.h:381:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                       if constexpr (IsTimeV2Type<ToDataType>) {
                       ^
   ```
   **be/src/vec/functions/function_cast.h:382:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                           if constexpr (IsDateTimeV2Type<ToDataType> && IsDateV2Type<FromDataType>) {
                           ^
   ```
   **be/src/vec/functions/function_cast.h:382:** +1
   ```cpp
                           if constexpr (IsDateTimeV2Type<ToDataType> && IsDateV2Type<FromDataType>) {
                                                                      ^
   ```
   **be/src/vec/functions/function_cast.h:384:** +1, nesting level increased to 5
   ```cpp
                           } else if constexpr (IsDateTimeV2Type<FromDataType> &&
                                  ^
   ```
   **be/src/vec/functions/function_cast.h:384:** +1
   ```cpp
                           } else if constexpr (IsDateTimeV2Type<FromDataType> &&
                                                                               ^
   ```
   **be/src/vec/functions/function_cast.h:387:** +1, nesting level increased to 5
   ```cpp
                           } else {
                             ^
   ```
   **be/src/vec/functions/function_cast.h:391:** +1, nesting level increased to 4
   ```cpp
                       } else if constexpr (IsTimeType<ToDataType>) {
                              ^
   ```
   **be/src/vec/functions/function_cast.h:392:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                           if constexpr (IsDateTimeType<ToDataType> && IsDateV2Type<FromDataType>) {
                           ^
   ```
   **be/src/vec/functions/function_cast.h:392:** +1
   ```cpp
                           if constexpr (IsDateTimeType<ToDataType> && IsDateV2Type<FromDataType>) {
                                                                    ^
   ```
   **be/src/vec/functions/function_cast.h:394:** +1, nesting level increased to 5
   ```cpp
                           } else if constexpr (IsDateType<ToDataType> && IsDateV2Type<FromDataType>) {
                                  ^
   ```
   **be/src/vec/functions/function_cast.h:394:** +1
   ```cpp
                           } else if constexpr (IsDateType<ToDataType> && IsDateV2Type<FromDataType>) {
                                                                       ^
   ```
   **be/src/vec/functions/function_cast.h:396:** +1, nesting level increased to 5
   ```cpp
                           } else if constexpr (IsDateTimeType<ToDataType> &&
                                  ^
   ```
   **be/src/vec/functions/function_cast.h:396:** +1
   ```cpp
                           } else if constexpr (IsDateTimeType<ToDataType> &&
                                                                           ^
   ```
   **be/src/vec/functions/function_cast.h:399:** +1, nesting level increased to 5
   ```cpp
                           } else if constexpr (IsDateType<ToDataType> &&
                                  ^
   ```
   **be/src/vec/functions/function_cast.h:399:** +1
   ```cpp
                           } else if constexpr (IsDateType<ToDataType> &&
                                                                       ^
   ```
   **be/src/vec/functions/function_cast.h:402:** +1, nesting level increased to 5
   ```cpp
                           } else {
                             ^
   ```
   **be/src/vec/functions/function_cast.h:405:** +1, nesting level increased to 4
   ```cpp
                       } else {
                         ^
   ```
   **be/src/vec/functions/function_cast.h:406:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                           if constexpr (IsDateTimeV2Type<FromDataType>) {
                           ^
   ```
   **be/src/vec/functions/function_cast.h:410:** +1, nesting level increased to 5
   ```cpp
                           } else {
                             ^
   ```
   **be/src/vec/functions/function_cast.h:417:** +1, nesting level increased to 2
   ```cpp
               } else {
                 ^
   ```
   **be/src/vec/functions/function_cast.h:418:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   if constexpr (IsDataTypeNumber<FromDataType> &&
                   ^
   ```
   **be/src/vec/functions/function_cast.h:425:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                       for (size_t i = 0; i < size; ++i) {
                       ^
   ```
   **be/src/vec/functions/function_cast.h:433:** +1, nesting level increased to 3
   ```cpp
                   } else {
                     ^
   ```
   **be/src/vec/functions/function_cast.h:434:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                       for (size_t i = 0; i < size; ++i) {
                       ^
   ```
   **be/src/vec/functions/function_cast.h:440:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (std::is_same_v<uint8_t, ToFieldType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:441:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   for (int i = 0; i < size; ++i) {
                   ^
   ```
   **be/src/vec/functions/function_cast.h:447:** +1, nesting level increased to 1
   ```cpp
           } else {
             ^
   ```
   
   </details>
   



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


Re: [PR] test [doris]

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

   (From new machine)TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 45.6 seconds
    stream load tsv:          591 seconds loaded 74807831229 Bytes, about 120 MB/s
    stream load json:         19 seconds loaded 2358488459 Bytes, about 118 MB/s
    stream load orc:          67 seconds loaded 1101869774 Bytes, about 15 MB/s
    stream load parquet:          31 seconds loaded 861443392 Bytes, about 26 MB/s
    insert into select:          28.8 seconds inserted 10000000 Rows, about 347K ops/s
    storage size: 17222944486 Bytes


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


Re: [PR] [Improvement](decimal) reduce overhead on disable check decimal overflow [doris]

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


##########
be/src/vec/functions/function_cast.h:
##########
@@ -256,9 +256,8 @@ struct ConvertImpl {
 
     template <typename Additions = void*>
     static Status execute(FunctionContext* context, Block& block, const ColumnNumbers& arguments,

Review Comment:
   warning: function 'execute' has cognitive complexity of 96 (threshold 50) [readability-function-cognitive-complexity]
   ```cpp
       static Status execute(FunctionContext* context, Block& block, const ColumnNumbers& arguments,
                     ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/vec/functions/function_cast.h:268:** +1, including nesting penalty of 0, nesting level increased to 1
   ```cpp
           if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
           ^
   ```
   **be/src/vec/functions/function_cast.h:268:** +1
   ```cpp
           if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
                                                         ^
   ```
   **be/src/vec/functions/function_cast.h:269:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || IsTimeType<FromDataType> ||
               ^
   ```
   **be/src/vec/functions/function_cast.h:270:** +1
   ```cpp
                               IsTimeV2Type<FromDataType>) ||
                                                           ^
   ```
   **be/src/vec/functions/function_cast.h:276:** +1, including nesting penalty of 0, nesting level increased to 1
   ```cpp
           if (const ColVecFrom* col_from =
           ^
   ```
   **be/src/vec/functions/function_cast.h:282:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (IsDataTypeDecimal<FromDataType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:294:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (IsDataTypeDecimal<ToDataType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:306:** +1, nesting level increased to 2
   ```cpp
               } else {
                 ^
   ```
   **be/src/vec/functions/function_cast.h:309:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (IsDataTypeNumber<ToDataType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:313:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (std::is_integral_v<ToFieldType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:323:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:323:** +1
   ```cpp
               if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
                                                             ^
   ```
   **be/src/vec/functions/function_cast.h:324:** +1
   ```cpp
                   bool narrow_integral = context->check_overflow_for_decimal() &&
                                                                                ^
   ```
   **be/src/vec/functions/function_cast.h:328:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   if (to_scale > from_scale) {
                   ^
   ```
   **be/src/vec/functions/function_cast.h:359:** +1, nesting level increased to 2
   ```cpp
               } else if constexpr (IsTimeType<FromDataType>) {
                      ^
   ```
   **be/src/vec/functions/function_cast.h:360:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   for (size_t i = 0; i < size; ++i) {
                   ^
   ```
   **be/src/vec/functions/function_cast.h:361:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                       if constexpr (IsTimeType<ToDataType>) {
                       ^
   ```
   **be/src/vec/functions/function_cast.h:363:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                           if constexpr (IsDateTimeType<ToDataType>) {
                           ^
   ```
   **be/src/vec/functions/function_cast.h:365:** +1, nesting level increased to 5
   ```cpp
                           } else {
                             ^
   ```
   **be/src/vec/functions/function_cast.h:368:** +1, nesting level increased to 4
   ```cpp
                       } else if constexpr (IsDateV2Type<ToDataType>) {
                              ^
   ```
   **be/src/vec/functions/function_cast.h:370:** +1, nesting level increased to 4
   ```cpp
                       } else if constexpr (IsDateTimeV2Type<ToDataType>) {
                              ^
   ```
   **be/src/vec/functions/function_cast.h:372:** +1, nesting level increased to 4
   ```cpp
                       } else {
                         ^
   ```
   **be/src/vec/functions/function_cast.h:377:** +1, nesting level increased to 2
   ```cpp
               } else if constexpr (IsTimeV2Type<FromDataType>) {
                      ^
   ```
   **be/src/vec/functions/function_cast.h:378:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   for (size_t i = 0; i < size; ++i) {
                   ^
   ```
   **be/src/vec/functions/function_cast.h:379:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                       if constexpr (IsTimeV2Type<ToDataType>) {
                       ^
   ```
   **be/src/vec/functions/function_cast.h:380:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                           if constexpr (IsDateTimeV2Type<ToDataType> && IsDateV2Type<FromDataType>) {
                           ^
   ```
   **be/src/vec/functions/function_cast.h:380:** +1
   ```cpp
                           if constexpr (IsDateTimeV2Type<ToDataType> && IsDateV2Type<FromDataType>) {
                                                                      ^
   ```
   **be/src/vec/functions/function_cast.h:382:** +1, nesting level increased to 5
   ```cpp
                           } else if constexpr (IsDateTimeV2Type<FromDataType> &&
                                  ^
   ```
   **be/src/vec/functions/function_cast.h:382:** +1
   ```cpp
                           } else if constexpr (IsDateTimeV2Type<FromDataType> &&
                                                                               ^
   ```
   **be/src/vec/functions/function_cast.h:385:** +1, nesting level increased to 5
   ```cpp
                           } else {
                             ^
   ```
   **be/src/vec/functions/function_cast.h:389:** +1, nesting level increased to 4
   ```cpp
                       } else if constexpr (IsTimeType<ToDataType>) {
                              ^
   ```
   **be/src/vec/functions/function_cast.h:390:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                           if constexpr (IsDateTimeType<ToDataType> && IsDateV2Type<FromDataType>) {
                           ^
   ```
   **be/src/vec/functions/function_cast.h:390:** +1
   ```cpp
                           if constexpr (IsDateTimeType<ToDataType> && IsDateV2Type<FromDataType>) {
                                                                    ^
   ```
   **be/src/vec/functions/function_cast.h:392:** +1, nesting level increased to 5
   ```cpp
                           } else if constexpr (IsDateType<ToDataType> && IsDateV2Type<FromDataType>) {
                                  ^
   ```
   **be/src/vec/functions/function_cast.h:392:** +1
   ```cpp
                           } else if constexpr (IsDateType<ToDataType> && IsDateV2Type<FromDataType>) {
                                                                       ^
   ```
   **be/src/vec/functions/function_cast.h:394:** +1, nesting level increased to 5
   ```cpp
                           } else if constexpr (IsDateTimeType<ToDataType> &&
                                  ^
   ```
   **be/src/vec/functions/function_cast.h:394:** +1
   ```cpp
                           } else if constexpr (IsDateTimeType<ToDataType> &&
                                                                           ^
   ```
   **be/src/vec/functions/function_cast.h:397:** +1, nesting level increased to 5
   ```cpp
                           } else if constexpr (IsDateType<ToDataType> &&
                                  ^
   ```
   **be/src/vec/functions/function_cast.h:397:** +1
   ```cpp
                           } else if constexpr (IsDateType<ToDataType> &&
                                                                       ^
   ```
   **be/src/vec/functions/function_cast.h:400:** +1, nesting level increased to 5
   ```cpp
                           } else {
                             ^
   ```
   **be/src/vec/functions/function_cast.h:403:** +1, nesting level increased to 4
   ```cpp
                       } else {
                         ^
   ```
   **be/src/vec/functions/function_cast.h:404:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                           if constexpr (IsDateTimeV2Type<FromDataType>) {
                           ^
   ```
   **be/src/vec/functions/function_cast.h:408:** +1, nesting level increased to 5
   ```cpp
                           } else {
                             ^
   ```
   **be/src/vec/functions/function_cast.h:415:** +1, nesting level increased to 2
   ```cpp
               } else {
                 ^
   ```
   **be/src/vec/functions/function_cast.h:416:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   if constexpr (IsDataTypeNumber<FromDataType> &&
                   ^
   ```
   **be/src/vec/functions/function_cast.h:423:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                       for (size_t i = 0; i < size; ++i) {
                       ^
   ```
   **be/src/vec/functions/function_cast.h:431:** +1, nesting level increased to 3
   ```cpp
                   } else {
                     ^
   ```
   **be/src/vec/functions/function_cast.h:432:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                       for (size_t i = 0; i < size; ++i) {
                       ^
   ```
   **be/src/vec/functions/function_cast.h:438:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (std::is_same_v<uint8_t, ToFieldType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:439:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   for (int i = 0; i < size; ++i) {
                   ^
   ```
   **be/src/vec/functions/function_cast.h:445:** +1, nesting level increased to 1
   ```cpp
           } else {
             ^
   ```
   
   </details>
   



##########
be/src/vec/data_types/data_type_decimal.h:
##########
@@ -410,73 +412,83 @@ constexpr bool IsDataTypeDecimalOrNumber =
 
 // only for casting between other integral types and decimals
 template <typename FromDataType, typename ToDataType, bool multiply_may_overflow,
-          bool narrow_integral>
+          bool narrow_integral, typename RealFrom, typename RealTo>
     requires IsDataTypeDecimal<FromDataType> && IsDataTypeDecimal<ToDataType>
-ToDataType::FieldType convert_decimals(const typename FromDataType::FieldType& value,
-                                       UInt32 scale_from, UInt32 scale_to,
-                                       const typename ToDataType::FieldType& min_result,
-                                       const typename ToDataType::FieldType& max_result) {
+void convert_to_decimals(RealTo* dst, const RealFrom* src, UInt32 scale_from, UInt32 scale_to,
+                         const typename ToDataType::FieldType& min_result,
+                         const typename ToDataType::FieldType& max_result, size_t size) {
     using FromFieldType = typename FromDataType::FieldType;
     using ToFieldType = typename ToDataType::FieldType;
-    using MaxFieldType =
-            std::conditional_t<(sizeof(FromFieldType) == sizeof(ToFieldType)) &&
-                                       (std::is_same_v<ToFieldType, Decimal128I> ||
-                                        std::is_same_v<FromFieldType, Decimal128I>),
-                               Decimal128I,
-                               std::conditional_t<(sizeof(FromFieldType) > sizeof(ToFieldType)),
-                                                  FromFieldType, ToFieldType>>;
+    using MaxFieldType = std::conditional_t<(sizeof(FromFieldType) > sizeof(ToFieldType)),
+                                            FromFieldType, ToFieldType>;
 
-    MaxFieldType converted_value;
+    DCHECK_GE(scale_to, scale_from);
     // from integer to decimal
-    if (scale_to > scale_from) {
-        converted_value =
-                DataTypeDecimal<MaxFieldType>::get_scale_multiplier(scale_to - scale_from);
+    MaxFieldType multiplier =
+            DataTypeDecimal<MaxFieldType>::get_scale_multiplier(scale_to - scale_from);
+    MaxFieldType tmp;
+    for (size_t i = 0; i < size; i++) {
         if constexpr (multiply_may_overflow) {
-            if (common::mul_overflow(static_cast<MaxFieldType>(value).value, converted_value.value,
-                                     converted_value.value)) {
+            if (common::mul_overflow(static_cast<MaxFieldType>(src[i]).value, multiplier.value,
+                                     tmp.value)) {
                 throw Exception(ErrorCode::ARITHMETIC_OVERFLOW_ERRROR, "Arithmetic overflow");
-            } else {
-                if constexpr (narrow_integral) {
-                    if (UNLIKELY(converted_value.value > max_result.value ||
-                                 converted_value.value < min_result.value)) {
-                        throw Exception(ErrorCode::ARITHMETIC_OVERFLOW_ERRROR,
-                                        "Arithmetic overflow");
-                    }
-                }
-            }
-        } else {
-            converted_value *= static_cast<MaxFieldType>(value).value;
-            if constexpr (narrow_integral) {
-                if (UNLIKELY(converted_value.value > max_result.value ||
-                             converted_value.value < min_result.value)) {
-                    throw Exception(ErrorCode::ARITHMETIC_OVERFLOW_ERRROR, "Arithmetic overflow");
-                }
             }
-        }
-    } else {
-        // from decimal to integer
-        converted_value =
-                static_cast<MaxFieldType>(value) /
-                DataTypeDecimal<MaxFieldType>::get_scale_multiplier(scale_from - scale_to);
-        if (value >= FromFieldType(0)) {
             if constexpr (narrow_integral) {
-                if (UNLIKELY(converted_value.value > max_result.value)) {
-                    throw Exception(ErrorCode::ARITHMETIC_OVERFLOW_ERRROR, "Arithmetic overflow");
+                if (tmp.value < min_result.value || tmp.value > max_result.value) {
+                    throw Exception(ErrorCode::ARITHMETIC_OVERFLOW_ERRROR,
+                                    "Arithmetic overflow, convert failed from {}, "
+                                    "expected data is [{}, {}]",
+                                    tmp.value, min_result.value, max_result.value);
                 }
             }
+            dst[i].value = tmp.value;
         } else {
-            if constexpr (narrow_integral) {
-                if (UNLIKELY(converted_value.value < min_result.value)) {
-                    throw Exception(ErrorCode::ARITHMETIC_OVERFLOW_ERRROR, "Arithmetic overflow");
-                }
+            dst[i].value = multiplier.value * static_cast<MaxFieldType>(src[i]).value;
+        }
+    }
+
+    if constexpr (!multiply_may_overflow && narrow_integral) {
+        for (size_t i = 0; i < size; i++) {
+            if (dst[i].value < min_result.value || dst[i].value > max_result.value) {
+                throw Exception(ErrorCode::ARITHMETIC_OVERFLOW_ERRROR,
+                                "Arithmetic overflow, convert failed from {}, "
+                                "expected data is [{}, {}]",
+                                dst[i].value, min_result.value, max_result.value);
             }
         }
     }
+}
 
-    return converted_value;
+// only for casting between other integral types and decimals
+template <typename FromDataType, typename ToDataType, bool narrow_integral, typename RealFrom,
+          typename RealTo>
+    requires IsDataTypeDecimal<FromDataType> && IsDataTypeDecimal<ToDataType>
+void convert_from_decimals(RealTo* dst, const RealFrom* src, UInt32 scale_from,
+                           const typename ToDataType::FieldType& min_result,
+                           const typename ToDataType::FieldType& max_result, size_t size) {
+    using FromFieldType = typename FromDataType::FieldType;
+    using ToFieldType = typename ToDataType::FieldType;
+    using MaxFieldType = std::conditional_t<(sizeof(FromFieldType) > sizeof(ToFieldType)),
+                                            FromFieldType, ToFieldType>;
+
+    // from decimal to integer
+    MaxFieldType multiplier = DataTypeDecimal<MaxFieldType>::get_scale_multiplier(scale_from);
+    for (size_t i = 0; i < size; i++) {
+        auto tmp = static_cast<MaxFieldType>(src[i]).value / multiplier.value;
+        if constexpr (narrow_integral) {
+            if (tmp < min_result.value || tmp > max_result.value) {
+                throw Exception(ErrorCode::ARITHMETIC_OVERFLOW_ERRROR,
+                                "Arithmetic overflow, convert failed from {}, "
+                                "expected data is [{}, {}]",
+                                tmp, min_result.value, max_result.value);
+            }
+        }
+        dst[i] = tmp;
+    }
 }
 
-template <typename FromDataType, typename ToDataType>
+template <typename FromDataType, typename ToDataType, bool multiply_may_overflow,
+          bool narrow_integral>
 void convert_decimal_cols(

Review Comment:
   warning: function 'convert_decimal_cols' has cognitive complexity of 66 (threshold 50) [readability-function-cognitive-complexity]
   ```cpp
   void convert_decimal_cols(
        ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/vec/data_types/data_type_decimal.h:509:** +1, including nesting penalty of 0, nesting level increased to 1
   ```cpp
       if (scale_to > scale_from) {
       ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:513:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
           for (size_t i = 0; i < sz; i++) {
           ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:514:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
               if constexpr (multiply_may_overflow) {
               ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:515:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                   if (common::mul_overflow(static_cast<MaxNativeType>(vec_from[i].value), multiplier,
                   ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:518:** +1, nesting level increased to 4
   ```cpp
                   } else {
                     ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:519:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                       if (UNLIKELY(res > max_result.value || res < -max_result.value)) {
                       ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:519:** +1
   ```cpp
                       if (UNLIKELY(res > max_result.value || res < -max_result.value)) {
                                                           ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:524:** +1, nesting level increased to 5
   ```cpp
                       } else {
                         ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:528:** +1, nesting level increased to 3
   ```cpp
               } else {
                 ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:530:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                   if constexpr (narrow_integral) {
                   ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:531:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                       if (UNLIKELY(res > max_result.value || res < -max_result.value)) {
                       ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:531:** +1
   ```cpp
                       if (UNLIKELY(res > max_result.value || res < -max_result.value)) {
                                                           ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:541:** +1, nesting level increased to 1
   ```cpp
       } else if (scale_to == scale_from) {
              ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:542:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
           for (size_t i = 0; i < sz; i++) {
           ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:543:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
               if constexpr (narrow_integral) {
               ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:544:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                   if (UNLIKELY(vec_from[i].value > max_result.value ||
                   ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:554:** +1, nesting level increased to 1
   ```cpp
       } else {
         ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:558:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
           for (size_t i = 0; i < sz; i++) {
           ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:559:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
               if (vec_from[i] >= FromFieldType(0)) {
               ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:560:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                   if constexpr (narrow_integral) {
                   ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:562:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                       if (UNLIKELY(res > max_result.value)) {
                       ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:569:** +1, nesting level increased to 4
   ```cpp
                   } else {
                     ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:572:** +1, nesting level increased to 3
   ```cpp
               } else {
                 ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:573:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                   if constexpr (narrow_integral) {
                   ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:575:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                       if (UNLIKELY(res < -max_result.value)) {
                       ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:582:** +1, nesting level increased to 4
   ```cpp
                   } else {
                     ^
   ```
   
   </details>
   



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


Re: [PR] test [doris]

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

   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


Re: [PR] [Improvement](decimal) reduce overhead on disable check decimal overflow [doris]

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


##########
be/src/vec/data_types/number_traits.h:
##########
@@ -220,7 +221,6 @@ template <typename T>
 /// Returns the maximum ascii string length for this type.
 /// e.g. the max/min int8_t has 3 characters.
 int max_ascii_len() {
-    LOG(FATAL) << "Not implemented.";

Review Comment:
   why not add dcheck or 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


Re: [PR] test [doris]

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


##########
be/src/vec/functions/function_cast.h:
##########
@@ -256,8 +256,7 @@ struct ConvertImpl {
 
     template <typename Additions = void*>
     static Status execute(FunctionContext* context, Block& block, const ColumnNumbers& arguments,

Review Comment:
   warning: function 'execute' has cognitive complexity of 103 (threshold 50) [readability-function-cognitive-complexity]
   ```cpp
       static Status execute(FunctionContext* context, Block& block, const ColumnNumbers& arguments,
                     ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/vec/functions/function_cast.h:268:** +1, including nesting penalty of 0, nesting level increased to 1
   ```cpp
           if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
           ^
   ```
   **be/src/vec/functions/function_cast.h:268:** +1
   ```cpp
           if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
                                                         ^
   ```
   **be/src/vec/functions/function_cast.h:269:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || IsTimeType<FromDataType> ||
               ^
   ```
   **be/src/vec/functions/function_cast.h:270:** +1
   ```cpp
                               IsTimeV2Type<FromDataType>) ||
                                                           ^
   ```
   **be/src/vec/functions/function_cast.h:276:** +1, including nesting penalty of 0, nesting level increased to 1
   ```cpp
           if (const ColVecFrom* col_from =
           ^
   ```
   **be/src/vec/functions/function_cast.h:282:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (IsDataTypeDecimal<FromDataType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:287:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (std::is_integral_v<FromFieldType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:297:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (IsDataTypeDecimal<ToDataType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:309:** +1, nesting level increased to 2
   ```cpp
               } else {
                 ^
   ```
   **be/src/vec/functions/function_cast.h:312:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (IsDataTypeNumber<ToDataType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:316:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (std::is_integral_v<ToFieldType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:326:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:326:** +1
   ```cpp
               if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
                                                             ^
   ```
   **be/src/vec/functions/function_cast.h:327:** +1
   ```cpp
                   bool narrow_integral = context->check_overflow_for_decimal() &&
                                                                                ^
   ```
   **be/src/vec/functions/function_cast.h:331:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   if (to_scale > from_scale) {
                   ^
   ```
   **be/src/vec/functions/function_cast.h:336:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   if constexpr (IsDataTypeDecimal<FromDataType> && IsDataTypeDecimal<ToDataType>) {
                   ^
   ```
   **be/src/vec/functions/function_cast.h:336:** +1
   ```cpp
                   if constexpr (IsDataTypeDecimal<FromDataType> && IsDataTypeDecimal<ToDataType>) {
                                                                 ^
   ```
   **be/src/vec/functions/function_cast.h:340:** +1, nesting level increased to 3
   ```cpp
                   } else {
                     ^
   ```
   **be/src/vec/functions/function_cast.h:376:** +1, nesting level increased to 2
   ```cpp
               } else if constexpr (IsTimeType<FromDataType>) {
                      ^
   ```
   **be/src/vec/functions/function_cast.h:377:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   for (size_t i = 0; i < size; ++i) {
                   ^
   ```
   **be/src/vec/functions/function_cast.h:378:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                       if constexpr (IsTimeType<ToDataType>) {
                       ^
   ```
   **be/src/vec/functions/function_cast.h:380:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                           if constexpr (IsDateTimeType<ToDataType>) {
                           ^
   ```
   **be/src/vec/functions/function_cast.h:382:** +1, nesting level increased to 5
   ```cpp
                           } else {
                             ^
   ```
   **be/src/vec/functions/function_cast.h:385:** +1, nesting level increased to 4
   ```cpp
                       } else if constexpr (IsDateV2Type<ToDataType>) {
                              ^
   ```
   **be/src/vec/functions/function_cast.h:387:** +1, nesting level increased to 4
   ```cpp
                       } else if constexpr (IsDateTimeV2Type<ToDataType>) {
                              ^
   ```
   **be/src/vec/functions/function_cast.h:389:** +1, nesting level increased to 4
   ```cpp
                       } else {
                         ^
   ```
   **be/src/vec/functions/function_cast.h:394:** +1, nesting level increased to 2
   ```cpp
               } else if constexpr (IsTimeV2Type<FromDataType>) {
                      ^
   ```
   **be/src/vec/functions/function_cast.h:395:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   for (size_t i = 0; i < size; ++i) {
                   ^
   ```
   **be/src/vec/functions/function_cast.h:396:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                       if constexpr (IsTimeV2Type<ToDataType>) {
                       ^
   ```
   **be/src/vec/functions/function_cast.h:397:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                           if constexpr (IsDateTimeV2Type<ToDataType> && IsDateV2Type<FromDataType>) {
                           ^
   ```
   **be/src/vec/functions/function_cast.h:397:** +1
   ```cpp
                           if constexpr (IsDateTimeV2Type<ToDataType> && IsDateV2Type<FromDataType>) {
                                                                      ^
   ```
   **be/src/vec/functions/function_cast.h:399:** +1, nesting level increased to 5
   ```cpp
                           } else if constexpr (IsDateTimeV2Type<FromDataType> &&
                                  ^
   ```
   **be/src/vec/functions/function_cast.h:399:** +1
   ```cpp
                           } else if constexpr (IsDateTimeV2Type<FromDataType> &&
                                                                               ^
   ```
   **be/src/vec/functions/function_cast.h:402:** +1, nesting level increased to 5
   ```cpp
                           } else {
                             ^
   ```
   **be/src/vec/functions/function_cast.h:406:** +1, nesting level increased to 4
   ```cpp
                       } else if constexpr (IsTimeType<ToDataType>) {
                              ^
   ```
   **be/src/vec/functions/function_cast.h:407:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                           if constexpr (IsDateTimeType<ToDataType> && IsDateV2Type<FromDataType>) {
                           ^
   ```
   **be/src/vec/functions/function_cast.h:407:** +1
   ```cpp
                           if constexpr (IsDateTimeType<ToDataType> && IsDateV2Type<FromDataType>) {
                                                                    ^
   ```
   **be/src/vec/functions/function_cast.h:409:** +1, nesting level increased to 5
   ```cpp
                           } else if constexpr (IsDateType<ToDataType> && IsDateV2Type<FromDataType>) {
                                  ^
   ```
   **be/src/vec/functions/function_cast.h:409:** +1
   ```cpp
                           } else if constexpr (IsDateType<ToDataType> && IsDateV2Type<FromDataType>) {
                                                                       ^
   ```
   **be/src/vec/functions/function_cast.h:411:** +1, nesting level increased to 5
   ```cpp
                           } else if constexpr (IsDateTimeType<ToDataType> &&
                                  ^
   ```
   **be/src/vec/functions/function_cast.h:411:** +1
   ```cpp
                           } else if constexpr (IsDateTimeType<ToDataType> &&
                                                                           ^
   ```
   **be/src/vec/functions/function_cast.h:414:** +1, nesting level increased to 5
   ```cpp
                           } else if constexpr (IsDateType<ToDataType> &&
                                  ^
   ```
   **be/src/vec/functions/function_cast.h:414:** +1
   ```cpp
                           } else if constexpr (IsDateType<ToDataType> &&
                                                                       ^
   ```
   **be/src/vec/functions/function_cast.h:417:** +1, nesting level increased to 5
   ```cpp
                           } else {
                             ^
   ```
   **be/src/vec/functions/function_cast.h:420:** +1, nesting level increased to 4
   ```cpp
                       } else {
                         ^
   ```
   **be/src/vec/functions/function_cast.h:421:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                           if constexpr (IsDateTimeV2Type<FromDataType>) {
                           ^
   ```
   **be/src/vec/functions/function_cast.h:425:** +1, nesting level increased to 5
   ```cpp
                           } else {
                             ^
   ```
   **be/src/vec/functions/function_cast.h:432:** +1, nesting level increased to 2
   ```cpp
               } else {
                 ^
   ```
   **be/src/vec/functions/function_cast.h:433:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   if constexpr (IsDataTypeNumber<FromDataType> &&
                   ^
   ```
   **be/src/vec/functions/function_cast.h:440:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                       for (size_t i = 0; i < size; ++i) {
                       ^
   ```
   **be/src/vec/functions/function_cast.h:448:** +1, nesting level increased to 3
   ```cpp
                   } else {
                     ^
   ```
   **be/src/vec/functions/function_cast.h:449:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                       for (size_t i = 0; i < size; ++i) {
                       ^
   ```
   **be/src/vec/functions/function_cast.h:455:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (std::is_same_v<uint8_t, ToFieldType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:456:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   for (int i = 0; i < size; ++i) {
                   ^
   ```
   **be/src/vec/functions/function_cast.h:462:** +1, nesting level increased to 1
   ```cpp
           } else {
             ^
   ```
   
   </details>
   



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


Re: [PR] test [doris]

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

   
   <details>
   <summary>TPC-H test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'</summary>
   
   ```
   Tpch sf100 test result on commit 7e2e6d1415c2e5d76e10e01ecc450f77c2039323, data reload: false
   
   run tpch-sf100 query with default conf and session variables
   q1	50144	31829	31847	31829
   q2	374	139	137	137
   q3	1568	1265	1204	1204
   q4	1116	915	892	892
   q5	3202	3217	3222	3217
   q6	266	140	142	140
   q7	1006	499	482	482
   q8	2169	2195	2199	2195
   q9	6941	6877	6869	6869
   q10	3265	3306	3303	3303
   q11	342	201	207	201
   q12	348	205	202	202
   q13	4602	3821	3801	3801
   q14	380	322	323	322
   q15	809	1294	1339	1294
   q16	443	382	391	382
   q17	1020	538	558	538
   q18	7498	6850	6858	6850
   q19	1527	1371	1440	1371
   q20	556	307	314	307
   q21	3062	2648	2638	2638
   q22	349	277	286	277
   Total cold run time: 90987 ms
   Total hot run time: 68451 ms
   
   run tpch-sf100 query with default conf and set session variable runtime_filter_mode=off
   q1	30798	31852	31826	31826
   q2	277	161	170	161
   q3	3668	3616	3608	3608
   q4	2397	2379	2386	2379
   q5	5806	5783	5806	5783
   q6	245	136	133	133
   q7	3071	3392	3400	3392
   q8	3540	3557	3547	3547
   q9	9235	9246	9174	9174
   q10	3973	4054	4042	4042
   q11	855	864	1369	864
   q12	765	588	612	588
   q13	4315	3558	3575	3558
   q14	508	440	444	440
   q15	1092	1334	1321	1321
   q16	504	457	482	457
   q17	1884	1841	1855	1841
   q18	8862	8338	8530	8338
   q19	1773	1791	1789	1789
   q20	2890	2628	2596	2596
   q21	6579	6218	6166	6166
   q22	514	422	412	412
   Total cold run time: 93551 ms
   Total hot run time: 92415 ms
   ```
   </details>
   


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


Re: [PR] [Improvement](decimal) reduce overhead on disable check decimal overflow [doris]

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

   (From new machine)TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 44.78 seconds
    stream load tsv:          586 seconds loaded 74807831229 Bytes, about 121 MB/s
    stream load json:         19 seconds loaded 2358488459 Bytes, about 118 MB/s
    stream load orc:          67 seconds loaded 1101869774 Bytes, about 15 MB/s
    stream load parquet:          31 seconds loaded 861443392 Bytes, about 26 MB/s
    insert into select:          29.1 seconds inserted 10000000 Rows, about 343K ops/s
    storage size: 17217994081 Bytes


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


Re: [PR] [Improvement](decimal) reduce overhead on disable check decimal overflow [doris]

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


##########
be/src/vec/data_types/number_traits.h:
##########
@@ -220,7 +221,6 @@ template <typename T>
 /// Returns the maximum ascii string length for this type.
 /// e.g. the max/min int8_t has 3 characters.
 int max_ascii_len() {
-    LOG(FATAL) << "Not implemented.";

Review Comment:
   On be/src/vec/functions/function_cast.h line 280, I use max_ascii_len to judge multiply may overflow



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


Re: [PR] [Improvement](decimal) reduce overhead on disable check decimal overflow [doris]

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

   
   <details>
   <summary>TPC-H test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'</summary>
   
   ```
   Tpch sf100 test result on commit 9d229f2d1743bc8be8e800c4ecc45083492b5df7, data reload: false
   
   run tpch-sf100 query with default conf and session variables
   q1	49824	31868	31804	31804
   q2	371	145	145	145
   q3	1562	1262	1220	1220
   q4	1128	911	876	876
   q5	3197	3227	3171	3171
   q6	263	151	139	139
   q7	1012	500	498	498
   q8	2148	2204	2190	2190
   q9	7007	6909	6894	6894
   q10	3261	3334	3312	3312
   q11	323	202	194	194
   q12	346	211	212	211
   q13	4587	3964	3772	3772
   q14	426	326	318	318
   q15	803	1304	1354	1304
   q16	441	389	395	389
   q17	1027	605	560	560
   q18	7791	7037	6871	6871
   q19	1538	1469	1369	1369
   q20	862	302	292	292
   q21	3056	2566	2611	2566
   q22	341	274	283	274
   Total cold run time: 91314 ms
   Total hot run time: 68369 ms
   
   run tpch-sf100 query with default conf and set session variable runtime_filter_mode=off
   q1	30786	31846	31777	31777
   q2	280	168	169	168
   q3	3617	3614	3603	3603
   q4	2394	2369	2369	2369
   q5	5861	5757	5829	5757
   q6	250	137	127	127
   q7	3045	3398	3377	3377
   q8	3530	3541	3526	3526
   q9	9119	9128	9018	9018
   q10	3984	4056	4065	4056
   q11	780	950	1333	950
   q12	759	604	604	604
   q13	4309	3568	3560	3560
   q14	510	430	440	430
   q15	1137	1319	1340	1319
   q16	504	462	473	462
   q17	1870	1866	1872	1866
   q18	8662	8049	8594	8049
   q19	1718	1779	1774	1774
   q20	2890	2584	2603	2584
   q21	6513	6095	6116	6095
   q22	495	414	410	410
   Total cold run time: 93013 ms
   Total hot run time: 91881 ms
   ```
   </details>
   


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


Re: [PR] test [doris]

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


##########
be/src/vec/functions/function_cast.h:
##########
@@ -256,9 +256,8 @@ struct ConvertImpl {
 
     template <typename Additions = void*>
     static Status execute(FunctionContext* context, Block& block, const ColumnNumbers& arguments,

Review Comment:
   warning: function 'execute' has cognitive complexity of 101 (threshold 50) [readability-function-cognitive-complexity]
   ```cpp
       static Status execute(FunctionContext* context, Block& block, const ColumnNumbers& arguments,
                     ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/vec/functions/function_cast.h:268:** +1, including nesting penalty of 0, nesting level increased to 1
   ```cpp
           if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
           ^
   ```
   **be/src/vec/functions/function_cast.h:268:** +1
   ```cpp
           if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
                                                         ^
   ```
   **be/src/vec/functions/function_cast.h:269:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || IsTimeType<FromDataType> ||
               ^
   ```
   **be/src/vec/functions/function_cast.h:270:** +1
   ```cpp
                               IsTimeV2Type<FromDataType>) ||
                                                           ^
   ```
   **be/src/vec/functions/function_cast.h:276:** +1, including nesting penalty of 0, nesting level increased to 1
   ```cpp
           if (const ColVecFrom* col_from =
           ^
   ```
   **be/src/vec/functions/function_cast.h:282:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (IsDataTypeDecimal<FromDataType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:294:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (IsDataTypeDecimal<ToDataType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:306:** +1, nesting level increased to 2
   ```cpp
               } else {
                 ^
   ```
   **be/src/vec/functions/function_cast.h:309:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (IsDataTypeNumber<ToDataType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:313:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (std::is_integral_v<ToFieldType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:323:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:323:** +1
   ```cpp
               if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
                                                             ^
   ```
   **be/src/vec/functions/function_cast.h:324:** +1
   ```cpp
                   bool narrow_integral = context->check_overflow_for_decimal() &&
                                                                                ^
   ```
   **be/src/vec/functions/function_cast.h:328:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   if (to_scale > from_scale) {
                   ^
   ```
   **be/src/vec/functions/function_cast.h:333:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   if constexpr (IsDataTypeDecimal<FromDataType> && IsDataTypeDecimal<ToDataType>) {
                   ^
   ```
   **be/src/vec/functions/function_cast.h:333:** +1
   ```cpp
                   if constexpr (IsDataTypeDecimal<FromDataType> && IsDataTypeDecimal<ToDataType>) {
                                                                 ^
   ```
   **be/src/vec/functions/function_cast.h:337:** +1, nesting level increased to 3
   ```cpp
                   } else {
                     ^
   ```
   **be/src/vec/functions/function_cast.h:358:** +1, nesting level increased to 2
   ```cpp
               } else if constexpr (IsTimeType<FromDataType>) {
                      ^
   ```
   **be/src/vec/functions/function_cast.h:359:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   for (size_t i = 0; i < size; ++i) {
                   ^
   ```
   **be/src/vec/functions/function_cast.h:360:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                       if constexpr (IsTimeType<ToDataType>) {
                       ^
   ```
   **be/src/vec/functions/function_cast.h:362:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                           if constexpr (IsDateTimeType<ToDataType>) {
                           ^
   ```
   **be/src/vec/functions/function_cast.h:364:** +1, nesting level increased to 5
   ```cpp
                           } else {
                             ^
   ```
   **be/src/vec/functions/function_cast.h:367:** +1, nesting level increased to 4
   ```cpp
                       } else if constexpr (IsDateV2Type<ToDataType>) {
                              ^
   ```
   **be/src/vec/functions/function_cast.h:369:** +1, nesting level increased to 4
   ```cpp
                       } else if constexpr (IsDateTimeV2Type<ToDataType>) {
                              ^
   ```
   **be/src/vec/functions/function_cast.h:371:** +1, nesting level increased to 4
   ```cpp
                       } else {
                         ^
   ```
   **be/src/vec/functions/function_cast.h:376:** +1, nesting level increased to 2
   ```cpp
               } else if constexpr (IsTimeV2Type<FromDataType>) {
                      ^
   ```
   **be/src/vec/functions/function_cast.h:377:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   for (size_t i = 0; i < size; ++i) {
                   ^
   ```
   **be/src/vec/functions/function_cast.h:378:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                       if constexpr (IsTimeV2Type<ToDataType>) {
                       ^
   ```
   **be/src/vec/functions/function_cast.h:379:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                           if constexpr (IsDateTimeV2Type<ToDataType> && IsDateV2Type<FromDataType>) {
                           ^
   ```
   **be/src/vec/functions/function_cast.h:379:** +1
   ```cpp
                           if constexpr (IsDateTimeV2Type<ToDataType> && IsDateV2Type<FromDataType>) {
                                                                      ^
   ```
   **be/src/vec/functions/function_cast.h:381:** +1, nesting level increased to 5
   ```cpp
                           } else if constexpr (IsDateTimeV2Type<FromDataType> &&
                                  ^
   ```
   **be/src/vec/functions/function_cast.h:381:** +1
   ```cpp
                           } else if constexpr (IsDateTimeV2Type<FromDataType> &&
                                                                               ^
   ```
   **be/src/vec/functions/function_cast.h:384:** +1, nesting level increased to 5
   ```cpp
                           } else {
                             ^
   ```
   **be/src/vec/functions/function_cast.h:388:** +1, nesting level increased to 4
   ```cpp
                       } else if constexpr (IsTimeType<ToDataType>) {
                              ^
   ```
   **be/src/vec/functions/function_cast.h:389:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                           if constexpr (IsDateTimeType<ToDataType> && IsDateV2Type<FromDataType>) {
                           ^
   ```
   **be/src/vec/functions/function_cast.h:389:** +1
   ```cpp
                           if constexpr (IsDateTimeType<ToDataType> && IsDateV2Type<FromDataType>) {
                                                                    ^
   ```
   **be/src/vec/functions/function_cast.h:391:** +1, nesting level increased to 5
   ```cpp
                           } else if constexpr (IsDateType<ToDataType> && IsDateV2Type<FromDataType>) {
                                  ^
   ```
   **be/src/vec/functions/function_cast.h:391:** +1
   ```cpp
                           } else if constexpr (IsDateType<ToDataType> && IsDateV2Type<FromDataType>) {
                                                                       ^
   ```
   **be/src/vec/functions/function_cast.h:393:** +1, nesting level increased to 5
   ```cpp
                           } else if constexpr (IsDateTimeType<ToDataType> &&
                                  ^
   ```
   **be/src/vec/functions/function_cast.h:393:** +1
   ```cpp
                           } else if constexpr (IsDateTimeType<ToDataType> &&
                                                                           ^
   ```
   **be/src/vec/functions/function_cast.h:396:** +1, nesting level increased to 5
   ```cpp
                           } else if constexpr (IsDateType<ToDataType> &&
                                  ^
   ```
   **be/src/vec/functions/function_cast.h:396:** +1
   ```cpp
                           } else if constexpr (IsDateType<ToDataType> &&
                                                                       ^
   ```
   **be/src/vec/functions/function_cast.h:399:** +1, nesting level increased to 5
   ```cpp
                           } else {
                             ^
   ```
   **be/src/vec/functions/function_cast.h:402:** +1, nesting level increased to 4
   ```cpp
                       } else {
                         ^
   ```
   **be/src/vec/functions/function_cast.h:403:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                           if constexpr (IsDateTimeV2Type<FromDataType>) {
                           ^
   ```
   **be/src/vec/functions/function_cast.h:407:** +1, nesting level increased to 5
   ```cpp
                           } else {
                             ^
   ```
   **be/src/vec/functions/function_cast.h:414:** +1, nesting level increased to 2
   ```cpp
               } else {
                 ^
   ```
   **be/src/vec/functions/function_cast.h:415:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   if constexpr (IsDataTypeNumber<FromDataType> &&
                   ^
   ```
   **be/src/vec/functions/function_cast.h:422:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                       for (size_t i = 0; i < size; ++i) {
                       ^
   ```
   **be/src/vec/functions/function_cast.h:430:** +1, nesting level increased to 3
   ```cpp
                   } else {
                     ^
   ```
   **be/src/vec/functions/function_cast.h:431:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                       for (size_t i = 0; i < size; ++i) {
                       ^
   ```
   **be/src/vec/functions/function_cast.h:437:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (std::is_same_v<uint8_t, ToFieldType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:438:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   for (int i = 0; i < size; ++i) {
                   ^
   ```
   **be/src/vec/functions/function_cast.h:444:** +1, nesting level increased to 1
   ```cpp
           } else {
             ^
   ```
   
   </details>
   



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


Re: [PR] [Improvement](decimal) reduce overhead on disable check decimal overflow [doris]

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

   
   <details>
   <summary>TPC-H test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'</summary>
   
   ```
   Tpch sf100 test result on commit 3e0bd118fdec0c427e20730d3531253763e534e1, data reload: false
   
   run tpch-sf100 query with default conf and session variables
   q1	51188	31885	31867	31867
   q2	366	138	138	138
   q3	1506	1248	1257	1248
   q4	1093	879	849	849
   q5	3193	3188	3225	3188
   q6	255	138	150	138
   q7	990	502	493	493
   q8	2153	2205	2205	2205
   q9	6884	6892	6863	6863
   q10	3296	3298	3300	3298
   q11	325	193	195	193
   q12	359	216	209	209
   q13	4712	3837	3782	3782
   q14	401	319	327	319
   q15	810	1304	1358	1304
   q16	454	385	400	385
   q17	1004	591	599	591
   q18	7184	7240	6798	6798
   q19	1529	1490	1381	1381
   q20	553	306	294	294
   q21	3077	2641	2643	2641
   q22	363	281	291	281
   Total cold run time: 91695 ms
   Total hot run time: 68465 ms
   
   run tpch-sf100 query with default conf and set session variable runtime_filter_mode=off
   q1	30848	31867	31846	31846
   q2	276	167	175	167
   q3	3665	3612	3604	3604
   q4	2386	2371	2369	2369
   q5	5768	5755	5756	5755
   q6	245	131	133	131
   q7	3049	3402	3373	3373
   q8	3543	3549	3547	3547
   q9	9232	9184	9158	9158
   q10	3976	4073	4060	4060
   q11	793	923	1357	923
   q12	779	596	615	596
   q13	4312	3538	3584	3538
   q14	518	436	423	423
   q15	1130	1359	1328	1328
   q16	506	473	466	466
   q17	1914	1865	1851	1851
   q18	8771	8206	8205	8205
   q19	1802	1772	1769	1769
   q20	2906	2601	2673	2601
   q21	6492	6147	6122	6122
   q22	505	427	436	427
   Total cold run time: 93416 ms
   Total hot run time: 92259 ms
   ```
   </details>
   


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


Re: [PR] some refactor of decimal [doris]

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

   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


Re: [PR] test [doris]

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


##########
be/src/vec/functions/function_cast.h:
##########
@@ -256,8 +256,7 @@ struct ConvertImpl {
 
     template <typename Additions = void*>
     static Status execute(FunctionContext* context, Block& block, const ColumnNumbers& arguments,

Review Comment:
   warning: function 'execute' has cognitive complexity of 103 (threshold 50) [readability-function-cognitive-complexity]
   ```cpp
       static Status execute(FunctionContext* context, Block& block, const ColumnNumbers& arguments,
                     ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/vec/functions/function_cast.h:268:** +1, including nesting penalty of 0, nesting level increased to 1
   ```cpp
           if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
           ^
   ```
   **be/src/vec/functions/function_cast.h:268:** +1
   ```cpp
           if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
                                                         ^
   ```
   **be/src/vec/functions/function_cast.h:269:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || IsTimeType<FromDataType> ||
               ^
   ```
   **be/src/vec/functions/function_cast.h:270:** +1
   ```cpp
                               IsTimeV2Type<FromDataType>) ||
                                                           ^
   ```
   **be/src/vec/functions/function_cast.h:276:** +1, including nesting penalty of 0, nesting level increased to 1
   ```cpp
           if (const ColVecFrom* col_from =
           ^
   ```
   **be/src/vec/functions/function_cast.h:282:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (IsDataTypeDecimal<FromDataType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:287:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (std::is_integral_v<FromFieldType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:297:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (IsDataTypeDecimal<ToDataType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:309:** +1, nesting level increased to 2
   ```cpp
               } else {
                 ^
   ```
   **be/src/vec/functions/function_cast.h:312:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (IsDataTypeNumber<ToDataType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:316:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (std::is_integral_v<ToFieldType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:326:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:326:** +1
   ```cpp
               if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
                                                             ^
   ```
   **be/src/vec/functions/function_cast.h:327:** +1
   ```cpp
                   bool narrow_integral = context->check_overflow_for_decimal() &&
                                                                                ^
   ```
   **be/src/vec/functions/function_cast.h:331:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   if (to_scale > from_scale) {
                   ^
   ```
   **be/src/vec/functions/function_cast.h:336:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   if constexpr (IsDataTypeDecimal<FromDataType> && IsDataTypeDecimal<ToDataType>) {
                   ^
   ```
   **be/src/vec/functions/function_cast.h:336:** +1
   ```cpp
                   if constexpr (IsDataTypeDecimal<FromDataType> && IsDataTypeDecimal<ToDataType>) {
                                                                 ^
   ```
   **be/src/vec/functions/function_cast.h:340:** +1, nesting level increased to 3
   ```cpp
                   } else {
                     ^
   ```
   **be/src/vec/functions/function_cast.h:367:** +1, nesting level increased to 2
   ```cpp
               } else if constexpr (IsTimeType<FromDataType>) {
                      ^
   ```
   **be/src/vec/functions/function_cast.h:368:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   for (size_t i = 0; i < size; ++i) {
                   ^
   ```
   **be/src/vec/functions/function_cast.h:369:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                       if constexpr (IsTimeType<ToDataType>) {
                       ^
   ```
   **be/src/vec/functions/function_cast.h:371:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                           if constexpr (IsDateTimeType<ToDataType>) {
                           ^
   ```
   **be/src/vec/functions/function_cast.h:373:** +1, nesting level increased to 5
   ```cpp
                           } else {
                             ^
   ```
   **be/src/vec/functions/function_cast.h:376:** +1, nesting level increased to 4
   ```cpp
                       } else if constexpr (IsDateV2Type<ToDataType>) {
                              ^
   ```
   **be/src/vec/functions/function_cast.h:378:** +1, nesting level increased to 4
   ```cpp
                       } else if constexpr (IsDateTimeV2Type<ToDataType>) {
                              ^
   ```
   **be/src/vec/functions/function_cast.h:380:** +1, nesting level increased to 4
   ```cpp
                       } else {
                         ^
   ```
   **be/src/vec/functions/function_cast.h:385:** +1, nesting level increased to 2
   ```cpp
               } else if constexpr (IsTimeV2Type<FromDataType>) {
                      ^
   ```
   **be/src/vec/functions/function_cast.h:386:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   for (size_t i = 0; i < size; ++i) {
                   ^
   ```
   **be/src/vec/functions/function_cast.h:387:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                       if constexpr (IsTimeV2Type<ToDataType>) {
                       ^
   ```
   **be/src/vec/functions/function_cast.h:388:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                           if constexpr (IsDateTimeV2Type<ToDataType> && IsDateV2Type<FromDataType>) {
                           ^
   ```
   **be/src/vec/functions/function_cast.h:388:** +1
   ```cpp
                           if constexpr (IsDateTimeV2Type<ToDataType> && IsDateV2Type<FromDataType>) {
                                                                      ^
   ```
   **be/src/vec/functions/function_cast.h:390:** +1, nesting level increased to 5
   ```cpp
                           } else if constexpr (IsDateTimeV2Type<FromDataType> &&
                                  ^
   ```
   **be/src/vec/functions/function_cast.h:390:** +1
   ```cpp
                           } else if constexpr (IsDateTimeV2Type<FromDataType> &&
                                                                               ^
   ```
   **be/src/vec/functions/function_cast.h:393:** +1, nesting level increased to 5
   ```cpp
                           } else {
                             ^
   ```
   **be/src/vec/functions/function_cast.h:397:** +1, nesting level increased to 4
   ```cpp
                       } else if constexpr (IsTimeType<ToDataType>) {
                              ^
   ```
   **be/src/vec/functions/function_cast.h:398:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                           if constexpr (IsDateTimeType<ToDataType> && IsDateV2Type<FromDataType>) {
                           ^
   ```
   **be/src/vec/functions/function_cast.h:398:** +1
   ```cpp
                           if constexpr (IsDateTimeType<ToDataType> && IsDateV2Type<FromDataType>) {
                                                                    ^
   ```
   **be/src/vec/functions/function_cast.h:400:** +1, nesting level increased to 5
   ```cpp
                           } else if constexpr (IsDateType<ToDataType> && IsDateV2Type<FromDataType>) {
                                  ^
   ```
   **be/src/vec/functions/function_cast.h:400:** +1
   ```cpp
                           } else if constexpr (IsDateType<ToDataType> && IsDateV2Type<FromDataType>) {
                                                                       ^
   ```
   **be/src/vec/functions/function_cast.h:402:** +1, nesting level increased to 5
   ```cpp
                           } else if constexpr (IsDateTimeType<ToDataType> &&
                                  ^
   ```
   **be/src/vec/functions/function_cast.h:402:** +1
   ```cpp
                           } else if constexpr (IsDateTimeType<ToDataType> &&
                                                                           ^
   ```
   **be/src/vec/functions/function_cast.h:405:** +1, nesting level increased to 5
   ```cpp
                           } else if constexpr (IsDateType<ToDataType> &&
                                  ^
   ```
   **be/src/vec/functions/function_cast.h:405:** +1
   ```cpp
                           } else if constexpr (IsDateType<ToDataType> &&
                                                                       ^
   ```
   **be/src/vec/functions/function_cast.h:408:** +1, nesting level increased to 5
   ```cpp
                           } else {
                             ^
   ```
   **be/src/vec/functions/function_cast.h:411:** +1, nesting level increased to 4
   ```cpp
                       } else {
                         ^
   ```
   **be/src/vec/functions/function_cast.h:412:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                           if constexpr (IsDateTimeV2Type<FromDataType>) {
                           ^
   ```
   **be/src/vec/functions/function_cast.h:416:** +1, nesting level increased to 5
   ```cpp
                           } else {
                             ^
   ```
   **be/src/vec/functions/function_cast.h:423:** +1, nesting level increased to 2
   ```cpp
               } else {
                 ^
   ```
   **be/src/vec/functions/function_cast.h:424:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   if constexpr (IsDataTypeNumber<FromDataType> &&
                   ^
   ```
   **be/src/vec/functions/function_cast.h:431:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                       for (size_t i = 0; i < size; ++i) {
                       ^
   ```
   **be/src/vec/functions/function_cast.h:439:** +1, nesting level increased to 3
   ```cpp
                   } else {
                     ^
   ```
   **be/src/vec/functions/function_cast.h:440:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                       for (size_t i = 0; i < size; ++i) {
                       ^
   ```
   **be/src/vec/functions/function_cast.h:446:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (std::is_same_v<uint8_t, ToFieldType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:447:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   for (int i = 0; i < size; ++i) {
                   ^
   ```
   **be/src/vec/functions/function_cast.h:453:** +1, nesting level increased to 1
   ```cpp
           } else {
             ^
   ```
   
   </details>
   



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


Re: [PR] test [doris]

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

   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


Re: [PR] test [doris]

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

   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


Re: [PR] test [doris]

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

   (From new machine)TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 44.95 seconds
    stream load tsv:          577 seconds loaded 74807831229 Bytes, about 123 MB/s
    stream load json:         19 seconds loaded 2358488459 Bytes, about 118 MB/s
    stream load orc:          66 seconds loaded 1101869774 Bytes, about 15 MB/s
    stream load parquet:          31 seconds loaded 861443392 Bytes, about 26 MB/s
    insert into select:          28.9 seconds inserted 10000000 Rows, about 346K ops/s
    storage size: 17219823513 Bytes


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


Re: [PR] test [doris]

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

   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


Re: [PR] test [doris]

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

   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


Re: [PR] [Improvement](decimal) reduce overhead on disable check decimal overflow [doris]

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

   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


Re: [PR] [Improvement](decimal) reduce overhead on disable check decimal overflow [doris]

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

   
   <details>
   <summary>TPC-H test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'</summary>
   
   ```
   Tpch sf100 test result on commit 9aa8c3df7e3b83db9b560f96fb80b8bac48cf366, data reload: false
   
   run tpch-sf100 query with default conf and session variables
   q1	4668	4441	4399	4399
   q2	360	164	161	161
   q3	1458	1231	1268	1231
   q4	1120	936	883	883
   q5	3141	3154	3188	3154
   q6	247	130	129	129
   q7	989	489	495	489
   q8	2207	2256	2194	2194
   q9	6706	6655	6715	6655
   q10	3208	3281	3264	3264
   q11	305	185	188	185
   q12	347	214	206	206
   q13	4549	3798	3803	3798
   q14	243	218	215	215
   q15	572	524	524	524
   q16	436	386	388	386
   q17	1025	583	564	564
   q18	7229	7025	6928	6928
   q19	1543	1439	1405	1405
   q20	510	300	281	281
   q21	3061	2674	2668	2668
   q22	350	279	296	279
   Total cold run time: 44274 ms
   Total hot run time: 39998 ms
   
   run tpch-sf100 query with default conf and set session variable runtime_filter_mode=off
   q1	4346	4330	4315	4315
   q2	265	169	176	169
   q3	3542	3517	3514	3514
   q4	2377	2375	2360	2360
   q5	5713	5731	5740	5731
   q6	242	119	119	119
   q7	2375	1895	1857	1857
   q8	3522	3527	3510	3510
   q9	9056	9019	9009	9009
   q10	3922	3988	3995	3988
   q11	482	368	362	362
   q12	763	585	593	585
   q13	4285	3579	3567	3567
   q14	280	247	258	247
   q15	576	527	519	519
   q16	502	439	449	439
   q17	1885	1856	1834	1834
   q18	8729	8332	8166	8166
   q19	1746	1777	1759	1759
   q20	2255	1951	1939	1939
   q21	6527	6181	6184	6181
   q22	511	430	437	430
   Total cold run time: 63901 ms
   Total hot run time: 60600 ms
   ```
   </details>
   


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


Re: [PR] [Improvement](decimal) reduce overhead on disable check decimal overflow [doris]

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

   PR approved by anyone and no changes requested.


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


Re: [PR] test [doris]

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

   (From new machine)TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 43.61 seconds
    stream load tsv:          589 seconds loaded 74807831229 Bytes, about 121 MB/s
    stream load json:         19 seconds loaded 2358488459 Bytes, about 118 MB/s
    stream load orc:          66 seconds loaded 1101869774 Bytes, about 15 MB/s
    stream load parquet:          33 seconds loaded 861443392 Bytes, about 24 MB/s
    insert into select:          28.7 seconds inserted 10000000 Rows, about 348K ops/s
    storage size: 17222753094 Bytes


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


Re: [PR] test [doris]

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

   (From new machine)TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 44.85 seconds
    stream load tsv:          577 seconds loaded 74807831229 Bytes, about 123 MB/s
    stream load json:         19 seconds loaded 2358488459 Bytes, about 118 MB/s
    stream load orc:          66 seconds loaded 1101869774 Bytes, about 15 MB/s
    stream load parquet:          31 seconds loaded 861443392 Bytes, about 26 MB/s
    insert into select:          28.8 seconds inserted 10000000 Rows, about 347K ops/s
    storage size: 17222896952 Bytes


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


Re: [PR] test [doris]

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

   (From new machine)TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 44.58 seconds
    stream load tsv:          580 seconds loaded 74807831229 Bytes, about 123 MB/s
    stream load json:         19 seconds loaded 2358488459 Bytes, about 118 MB/s
    stream load orc:          66 seconds loaded 1101869774 Bytes, about 15 MB/s
    stream load parquet:          32 seconds loaded 861443392 Bytes, about 25 MB/s
    insert into select:          29.2 seconds inserted 10000000 Rows, about 342K ops/s
    storage size: 17219563238 Bytes


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


Re: [PR] [Improvement](decimal) reduce overhead on disable check decimal overflow [doris]

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

   (From new machine)TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 43.78 seconds
    stream load tsv:          577 seconds loaded 74807831229 Bytes, about 123 MB/s
    stream load json:         19 seconds loaded 2358488459 Bytes, about 118 MB/s
    stream load orc:          66 seconds loaded 1101869774 Bytes, about 15 MB/s
    stream load parquet:          33 seconds loaded 861443392 Bytes, about 24 MB/s
    insert into select:          28.5 seconds inserted 10000000 Rows, about 350K ops/s
    storage size: 17222299710 Bytes


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


Re: [PR] [Improvement](decimal) reduce overhead on disable check decimal overflow [doris]

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

   PR approved by at least one committer and no changes requested.


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


Re: [PR] test [doris]

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

   
   <details>
   <summary>TPC-H test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'</summary>
   
   ```
   Tpch sf100 test result on commit 540530982a63b335ea97020640c7d4845f2d36f1, data reload: false
   
   run tpch-sf100 query with default conf and session variables
   q1	49895	31841	31791	31791
   q2	392	143	148	143
   q3	1610	1267	1215	1215
   q4	1126	928	952	928
   q5	3183	3169	3170	3169
   q6	265	144	141	141
   q7	1001	489	480	480
   q8	2158	2198	2200	2198
   q9	6882	6869	6904	6869
   q10	3226	3295	3319	3295
   q11	318	191	198	191
   q12	344	219	213	213
   q13	4559	3796	3813	3796
   q14	439	310	316	310
   q15	793	1309	1316	1309
   q16	437	385	400	385
   q17	1025	588	537	537
   q18	7805	7431	6954	6954
   q19	1512	1353	1482	1353
   q20	560	308	321	308
   q21	3080	2634	2665	2634
   q22	348	284	289	284
   Total cold run time: 90958 ms
   Total hot run time: 68503 ms
   
   run tpch-sf100 query with default conf and set session variable runtime_filter_mode=off
   q1	30761	31831	31816	31816
   q2	269	170	174	170
   q3	3669	3577	3606	3577
   q4	2400	2393	2390	2390
   q5	5786	5776	5761	5761
   q6	244	128	133	128
   q7	3051	3400	3364	3364
   q8	3532	3536	3531	3531
   q9	9230	9140	9207	9140
   q10	3951	4042	4044	4042
   q11	798	907	1360	907
   q12	767	629	590	590
   q13	4297	3543	3512	3512
   q14	497	438	427	427
   q15	1136	1327	1326	1326
   q16	499	467	458	458
   q17	1906	1860	1855	1855
   q18	8761	8245	8251	8245
   q19	1753	1747	1753	1747
   q20	2911	2579	2671	2579
   q21	6543	6166	6157	6157
   q22	497	423	420	420
   Total cold run time: 93258 ms
   Total hot run time: 92142 ms
   ```
   </details>
   


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


Re: [PR] test [doris]

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


##########
be/src/vec/data_types/data_type_decimal.h:
##########
@@ -410,73 +412,69 @@ constexpr bool IsDataTypeDecimalOrNumber =
 
 // only for casting between other integral types and decimals
 template <typename FromDataType, typename ToDataType, bool multiply_may_overflow,
-          bool narrow_integral>
+          bool narrow_integral, typename RealFrom, typename RealTo>
     requires IsDataTypeDecimal<FromDataType> && IsDataTypeDecimal<ToDataType>
-ToDataType::FieldType convert_decimals(const typename FromDataType::FieldType& value,
-                                       UInt32 scale_from, UInt32 scale_to,
-                                       const typename ToDataType::FieldType& min_result,
-                                       const typename ToDataType::FieldType& max_result) {
+void convert_to_decimals(RealTo* dst, const RealFrom* src, UInt32 scale_from, UInt32 scale_to,
+                         const typename ToDataType::FieldType& min_result,
+                         const typename ToDataType::FieldType& max_result, size_t size) {
     using FromFieldType = typename FromDataType::FieldType;
     using ToFieldType = typename ToDataType::FieldType;
-    using MaxFieldType =
-            std::conditional_t<(sizeof(FromFieldType) == sizeof(ToFieldType)) &&
-                                       (std::is_same_v<ToFieldType, Decimal128I> ||
-                                        std::is_same_v<FromFieldType, Decimal128I>),
-                               Decimal128I,
-                               std::conditional_t<(sizeof(FromFieldType) > sizeof(ToFieldType)),
-                                                  FromFieldType, ToFieldType>>;
+    using MaxFieldType = std::conditional_t<(sizeof(FromFieldType) > sizeof(ToFieldType)),
+                                            FromFieldType, ToFieldType>;
 
-    MaxFieldType converted_value;
+    DCHECK_GE(scale_to, scale_from);
     // from integer to decimal
-    if (scale_to > scale_from) {
-        converted_value =
-                DataTypeDecimal<MaxFieldType>::get_scale_multiplier(scale_to - scale_from);
+    MaxFieldType multiplier =
+            DataTypeDecimal<MaxFieldType>::get_scale_multiplier(scale_to - scale_from);
+    MaxFieldType tmp;
+    for (size_t i = 0; i < size; i++) {
         if constexpr (multiply_may_overflow) {
-            if (common::mul_overflow(static_cast<MaxFieldType>(value).value, converted_value.value,
-                                     converted_value.value)) {
+            if (common::mul_overflow(static_cast<MaxFieldType>(src[i]).value, multiplier.value,
+                                     tmp.value)) {
                 throw Exception(ErrorCode::ARITHMETIC_OVERFLOW_ERRROR, "Arithmetic overflow");
-            } else {
-                if constexpr (narrow_integral) {
-                    if (UNLIKELY(converted_value.value > max_result.value ||
-                                 converted_value.value < min_result.value)) {
-                        throw Exception(ErrorCode::ARITHMETIC_OVERFLOW_ERRROR,
-                                        "Arithmetic overflow");
-                    }
-                }
-            }
-        } else {
-            converted_value *= static_cast<MaxFieldType>(value).value;
-            if constexpr (narrow_integral) {
-                if (UNLIKELY(converted_value.value > max_result.value ||
-                             converted_value.value < min_result.value)) {
-                    throw Exception(ErrorCode::ARITHMETIC_OVERFLOW_ERRROR, "Arithmetic overflow");
-                }
             }
-        }
-    } else {
-        // from decimal to integer
-        converted_value =
-                static_cast<MaxFieldType>(value) /
-                DataTypeDecimal<MaxFieldType>::get_scale_multiplier(scale_from - scale_to);
-        if (value >= FromFieldType(0)) {
             if constexpr (narrow_integral) {
-                if (UNLIKELY(converted_value.value > max_result.value)) {
-                    throw Exception(ErrorCode::ARITHMETIC_OVERFLOW_ERRROR, "Arithmetic overflow");
+                if (tmp.value < min_result.value || tmp.value > max_result.value) {
+                    throw Exception(ErrorCode::ARITHMETIC_OVERFLOW_ERRROR,
+                                    "Arithmetic overflow, convert failed from {}, "
+                                    "expected data is [{}, {}]",
+                                    tmp.value, min_result.value, max_result.value);
                 }
             }
+            dst[i].value = tmp.value;
         } else {
+            dst[i].value = multiplier.value * static_cast<MaxFieldType>(src[i]).value;
             if constexpr (narrow_integral) {
-                if (UNLIKELY(converted_value.value < min_result.value)) {
-                    throw Exception(ErrorCode::ARITHMETIC_OVERFLOW_ERRROR, "Arithmetic overflow");
+                if (dst[i].value < min_result.value || dst[i].value > max_result.value) {
+                    throw Exception(ErrorCode::ARITHMETIC_OVERFLOW_ERRROR,
+                                    "Arithmetic overflow, convert failed from {}, "
+                                    "expected data is [{}, {}]",
+                                    dst[i].value, min_result.value, max_result.value);
                 }
             }
         }
     }
+}
+
+// only for casting between other integral types and decimals
+template <typename FromDataType, typename ToDataType, bool multiply_may_overflow,
+          bool narrow_integral, typename RealFrom, typename RealTo>
+    requires IsDataTypeDecimal<FromDataType> && IsDataTypeDecimal<ToDataType>
+void convert_from_decimals(RealTo* dst, const RealFrom* src, UInt32 scale_from, size_t size) {
+    using FromFieldType = typename FromDataType::FieldType;
+    using ToFieldType = typename ToDataType::FieldType;
+    using MaxFieldType = std::conditional_t<(sizeof(FromFieldType) > sizeof(ToFieldType)),
+                                            FromFieldType, ToFieldType>;
 
-    return converted_value;
+    // from decimal to integer
+    MaxFieldType multiplier = DataTypeDecimal<MaxFieldType>::get_scale_multiplier(scale_from);
+    for (size_t i = 0; i < size; i++) {
+        dst[i] = static_cast<MaxFieldType>(src[i]).value / multiplier.value;
+    }
 }
 
-template <typename FromDataType, typename ToDataType>
+template <typename FromDataType, typename ToDataType, bool multiply_may_overflow,
+          bool narrow_integral>
 void convert_decimal_cols(

Review Comment:
   warning: function 'convert_decimal_cols' has cognitive complexity of 66 (threshold 50) [readability-function-cognitive-complexity]
   ```cpp
   void convert_decimal_cols(
        ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/vec/data_types/data_type_decimal.h:495:** +1, including nesting penalty of 0, nesting level increased to 1
   ```cpp
       if (scale_to > scale_from) {
       ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:499:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
           for (size_t i = 0; i < sz; i++) {
           ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:500:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
               if constexpr (multiply_may_overflow) {
               ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:501:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                   if (common::mul_overflow(static_cast<MaxNativeType>(vec_from[i].value), multiplier,
                   ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:504:** +1, nesting level increased to 4
   ```cpp
                   } else {
                     ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:505:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                       if (UNLIKELY(res > max_result.value || res < -max_result.value)) {
                       ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:505:** +1
   ```cpp
                       if (UNLIKELY(res > max_result.value || res < -max_result.value)) {
                                                           ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:510:** +1, nesting level increased to 5
   ```cpp
                       } else {
                         ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:514:** +1, nesting level increased to 3
   ```cpp
               } else {
                 ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:516:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                   if constexpr (narrow_integral) {
                   ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:517:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                       if (UNLIKELY(res > max_result.value || res < -max_result.value)) {
                       ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:517:** +1
   ```cpp
                       if (UNLIKELY(res > max_result.value || res < -max_result.value)) {
                                                           ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:527:** +1, nesting level increased to 1
   ```cpp
       } else if (scale_to == scale_from) {
              ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:528:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
           for (size_t i = 0; i < sz; i++) {
           ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:529:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
               if constexpr (narrow_integral) {
               ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:530:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                   if (UNLIKELY(vec_from[i].value > max_result.value ||
                   ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:540:** +1, nesting level increased to 1
   ```cpp
       } else {
         ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:544:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
           for (size_t i = 0; i < sz; i++) {
           ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:545:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
               if (vec_from[i] >= FromFieldType(0)) {
               ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:546:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                   if constexpr (narrow_integral) {
                   ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:548:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                       if (UNLIKELY(res > max_result.value)) {
                       ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:555:** +1, nesting level increased to 4
   ```cpp
                   } else {
                     ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:558:** +1, nesting level increased to 3
   ```cpp
               } else {
                 ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:559:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                   if constexpr (narrow_integral) {
                   ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:561:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                       if (UNLIKELY(res < -max_result.value)) {
                       ^
   ```
   **be/src/vec/data_types/data_type_decimal.h:568:** +1, nesting level increased to 4
   ```cpp
                   } else {
                     ^
   ```
   
   </details>
   



##########
be/src/vec/functions/function_cast.h:
##########
@@ -256,9 +256,8 @@ struct ConvertImpl {
 
     template <typename Additions = void*>
     static Status execute(FunctionContext* context, Block& block, const ColumnNumbers& arguments,

Review Comment:
   warning: function 'execute' has cognitive complexity of 96 (threshold 50) [readability-function-cognitive-complexity]
   ```cpp
       static Status execute(FunctionContext* context, Block& block, const ColumnNumbers& arguments,
                     ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/vec/functions/function_cast.h:268:** +1, including nesting penalty of 0, nesting level increased to 1
   ```cpp
           if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
           ^
   ```
   **be/src/vec/functions/function_cast.h:268:** +1
   ```cpp
           if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
                                                         ^
   ```
   **be/src/vec/functions/function_cast.h:269:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (!(IsDataTypeDecimalOrNumber<FromDataType> || IsTimeType<FromDataType> ||
               ^
   ```
   **be/src/vec/functions/function_cast.h:270:** +1
   ```cpp
                               IsTimeV2Type<FromDataType>) ||
                                                           ^
   ```
   **be/src/vec/functions/function_cast.h:276:** +1, including nesting penalty of 0, nesting level increased to 1
   ```cpp
           if (const ColVecFrom* col_from =
           ^
   ```
   **be/src/vec/functions/function_cast.h:282:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (IsDataTypeDecimal<FromDataType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:294:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (IsDataTypeDecimal<ToDataType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:306:** +1, nesting level increased to 2
   ```cpp
               } else {
                 ^
   ```
   **be/src/vec/functions/function_cast.h:309:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (IsDataTypeNumber<ToDataType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:313:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (std::is_integral_v<ToFieldType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:323:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:323:** +1
   ```cpp
               if constexpr (IsDataTypeDecimal<FromDataType> || IsDataTypeDecimal<ToDataType>) {
                                                             ^
   ```
   **be/src/vec/functions/function_cast.h:324:** +1
   ```cpp
                   bool narrow_integral = context->check_overflow_for_decimal() &&
                                                                                ^
   ```
   **be/src/vec/functions/function_cast.h:328:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   if (to_scale > from_scale) {
                   ^
   ```
   **be/src/vec/functions/function_cast.h:358:** +1, nesting level increased to 2
   ```cpp
               } else if constexpr (IsTimeType<FromDataType>) {
                      ^
   ```
   **be/src/vec/functions/function_cast.h:359:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   for (size_t i = 0; i < size; ++i) {
                   ^
   ```
   **be/src/vec/functions/function_cast.h:360:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                       if constexpr (IsTimeType<ToDataType>) {
                       ^
   ```
   **be/src/vec/functions/function_cast.h:362:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                           if constexpr (IsDateTimeType<ToDataType>) {
                           ^
   ```
   **be/src/vec/functions/function_cast.h:364:** +1, nesting level increased to 5
   ```cpp
                           } else {
                             ^
   ```
   **be/src/vec/functions/function_cast.h:367:** +1, nesting level increased to 4
   ```cpp
                       } else if constexpr (IsDateV2Type<ToDataType>) {
                              ^
   ```
   **be/src/vec/functions/function_cast.h:369:** +1, nesting level increased to 4
   ```cpp
                       } else if constexpr (IsDateTimeV2Type<ToDataType>) {
                              ^
   ```
   **be/src/vec/functions/function_cast.h:371:** +1, nesting level increased to 4
   ```cpp
                       } else {
                         ^
   ```
   **be/src/vec/functions/function_cast.h:376:** +1, nesting level increased to 2
   ```cpp
               } else if constexpr (IsTimeV2Type<FromDataType>) {
                      ^
   ```
   **be/src/vec/functions/function_cast.h:377:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   for (size_t i = 0; i < size; ++i) {
                   ^
   ```
   **be/src/vec/functions/function_cast.h:378:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                       if constexpr (IsTimeV2Type<ToDataType>) {
                       ^
   ```
   **be/src/vec/functions/function_cast.h:379:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                           if constexpr (IsDateTimeV2Type<ToDataType> && IsDateV2Type<FromDataType>) {
                           ^
   ```
   **be/src/vec/functions/function_cast.h:379:** +1
   ```cpp
                           if constexpr (IsDateTimeV2Type<ToDataType> && IsDateV2Type<FromDataType>) {
                                                                      ^
   ```
   **be/src/vec/functions/function_cast.h:381:** +1, nesting level increased to 5
   ```cpp
                           } else if constexpr (IsDateTimeV2Type<FromDataType> &&
                                  ^
   ```
   **be/src/vec/functions/function_cast.h:381:** +1
   ```cpp
                           } else if constexpr (IsDateTimeV2Type<FromDataType> &&
                                                                               ^
   ```
   **be/src/vec/functions/function_cast.h:384:** +1, nesting level increased to 5
   ```cpp
                           } else {
                             ^
   ```
   **be/src/vec/functions/function_cast.h:388:** +1, nesting level increased to 4
   ```cpp
                       } else if constexpr (IsTimeType<ToDataType>) {
                              ^
   ```
   **be/src/vec/functions/function_cast.h:389:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                           if constexpr (IsDateTimeType<ToDataType> && IsDateV2Type<FromDataType>) {
                           ^
   ```
   **be/src/vec/functions/function_cast.h:389:** +1
   ```cpp
                           if constexpr (IsDateTimeType<ToDataType> && IsDateV2Type<FromDataType>) {
                                                                    ^
   ```
   **be/src/vec/functions/function_cast.h:391:** +1, nesting level increased to 5
   ```cpp
                           } else if constexpr (IsDateType<ToDataType> && IsDateV2Type<FromDataType>) {
                                  ^
   ```
   **be/src/vec/functions/function_cast.h:391:** +1
   ```cpp
                           } else if constexpr (IsDateType<ToDataType> && IsDateV2Type<FromDataType>) {
                                                                       ^
   ```
   **be/src/vec/functions/function_cast.h:393:** +1, nesting level increased to 5
   ```cpp
                           } else if constexpr (IsDateTimeType<ToDataType> &&
                                  ^
   ```
   **be/src/vec/functions/function_cast.h:393:** +1
   ```cpp
                           } else if constexpr (IsDateTimeType<ToDataType> &&
                                                                           ^
   ```
   **be/src/vec/functions/function_cast.h:396:** +1, nesting level increased to 5
   ```cpp
                           } else if constexpr (IsDateType<ToDataType> &&
                                  ^
   ```
   **be/src/vec/functions/function_cast.h:396:** +1
   ```cpp
                           } else if constexpr (IsDateType<ToDataType> &&
                                                                       ^
   ```
   **be/src/vec/functions/function_cast.h:399:** +1, nesting level increased to 5
   ```cpp
                           } else {
                             ^
   ```
   **be/src/vec/functions/function_cast.h:402:** +1, nesting level increased to 4
   ```cpp
                       } else {
                         ^
   ```
   **be/src/vec/functions/function_cast.h:403:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                           if constexpr (IsDateTimeV2Type<FromDataType>) {
                           ^
   ```
   **be/src/vec/functions/function_cast.h:407:** +1, nesting level increased to 5
   ```cpp
                           } else {
                             ^
   ```
   **be/src/vec/functions/function_cast.h:414:** +1, nesting level increased to 2
   ```cpp
               } else {
                 ^
   ```
   **be/src/vec/functions/function_cast.h:415:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   if constexpr (IsDataTypeNumber<FromDataType> &&
                   ^
   ```
   **be/src/vec/functions/function_cast.h:422:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                       for (size_t i = 0; i < size; ++i) {
                       ^
   ```
   **be/src/vec/functions/function_cast.h:430:** +1, nesting level increased to 3
   ```cpp
                   } else {
                     ^
   ```
   **be/src/vec/functions/function_cast.h:431:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                       for (size_t i = 0; i < size; ++i) {
                       ^
   ```
   **be/src/vec/functions/function_cast.h:437:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
               if constexpr (std::is_same_v<uint8_t, ToFieldType>) {
               ^
   ```
   **be/src/vec/functions/function_cast.h:438:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                   for (int i = 0; i < size; ++i) {
                   ^
   ```
   **be/src/vec/functions/function_cast.h:444:** +1, nesting level increased to 1
   ```cpp
           } else {
             ^
   ```
   
   </details>
   



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


Re: [PR] [Improvement](decimal) reduce overhead on disable check decimal overflow [doris]

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


##########
be/src/vec/data_types/data_type_decimal.h:
##########
@@ -410,73 +412,69 @@ constexpr bool IsDataTypeDecimalOrNumber =
 
 // only for casting between other integral types and decimals
 template <typename FromDataType, typename ToDataType, bool multiply_may_overflow,
-          bool narrow_integral>
+          bool narrow_integral, typename RealFrom, typename RealTo>
     requires IsDataTypeDecimal<FromDataType> && IsDataTypeDecimal<ToDataType>
-ToDataType::FieldType convert_decimals(const typename FromDataType::FieldType& value,
-                                       UInt32 scale_from, UInt32 scale_to,
-                                       const typename ToDataType::FieldType& min_result,
-                                       const typename ToDataType::FieldType& max_result) {
+void convert_to_decimals(RealTo* dst, const RealFrom* src, UInt32 scale_from, UInt32 scale_to,
+                         const typename ToDataType::FieldType& min_result,
+                         const typename ToDataType::FieldType& max_result, size_t size) {
     using FromFieldType = typename FromDataType::FieldType;
     using ToFieldType = typename ToDataType::FieldType;
-    using MaxFieldType =
-            std::conditional_t<(sizeof(FromFieldType) == sizeof(ToFieldType)) &&
-                                       (std::is_same_v<ToFieldType, Decimal128I> ||
-                                        std::is_same_v<FromFieldType, Decimal128I>),
-                               Decimal128I,
-                               std::conditional_t<(sizeof(FromFieldType) > sizeof(ToFieldType)),
-                                                  FromFieldType, ToFieldType>>;
+    using MaxFieldType = std::conditional_t<(sizeof(FromFieldType) > sizeof(ToFieldType)),
+                                            FromFieldType, ToFieldType>;
 
-    MaxFieldType converted_value;
+    DCHECK_GE(scale_to, scale_from);
     // from integer to decimal
-    if (scale_to > scale_from) {
-        converted_value =
-                DataTypeDecimal<MaxFieldType>::get_scale_multiplier(scale_to - scale_from);
+    MaxFieldType multiplier =
+            DataTypeDecimal<MaxFieldType>::get_scale_multiplier(scale_to - scale_from);
+    MaxFieldType tmp;
+    for (size_t i = 0; i < size; i++) {
         if constexpr (multiply_may_overflow) {
-            if (common::mul_overflow(static_cast<MaxFieldType>(value).value, converted_value.value,
-                                     converted_value.value)) {
+            if (common::mul_overflow(static_cast<MaxFieldType>(src[i]).value, multiplier.value,
+                                     tmp.value)) {
                 throw Exception(ErrorCode::ARITHMETIC_OVERFLOW_ERRROR, "Arithmetic overflow");
-            } else {
-                if constexpr (narrow_integral) {
-                    if (UNLIKELY(converted_value.value > max_result.value ||
-                                 converted_value.value < min_result.value)) {
-                        throw Exception(ErrorCode::ARITHMETIC_OVERFLOW_ERRROR,
-                                        "Arithmetic overflow");
-                    }
-                }
-            }
-        } else {
-            converted_value *= static_cast<MaxFieldType>(value).value;
-            if constexpr (narrow_integral) {
-                if (UNLIKELY(converted_value.value > max_result.value ||
-                             converted_value.value < min_result.value)) {
-                    throw Exception(ErrorCode::ARITHMETIC_OVERFLOW_ERRROR, "Arithmetic overflow");
-                }
             }
-        }
-    } else {
-        // from decimal to integer
-        converted_value =
-                static_cast<MaxFieldType>(value) /
-                DataTypeDecimal<MaxFieldType>::get_scale_multiplier(scale_from - scale_to);
-        if (value >= FromFieldType(0)) {
             if constexpr (narrow_integral) {
-                if (UNLIKELY(converted_value.value > max_result.value)) {
-                    throw Exception(ErrorCode::ARITHMETIC_OVERFLOW_ERRROR, "Arithmetic overflow");
+                if (tmp.value < min_result.value || tmp.value > max_result.value) {
+                    throw Exception(ErrorCode::ARITHMETIC_OVERFLOW_ERRROR,
+                                    "Arithmetic overflow, convert failed from {}, "
+                                    "expected data is [{}, {}]",
+                                    tmp.value, min_result.value, max_result.value);
                 }
             }
+            dst[i].value = tmp.value;
         } else {
+            dst[i].value = multiplier.value * static_cast<MaxFieldType>(src[i]).value;
             if constexpr (narrow_integral) {
-                if (UNLIKELY(converted_value.value < min_result.value)) {
-                    throw Exception(ErrorCode::ARITHMETIC_OVERFLOW_ERRROR, "Arithmetic overflow");
+                if (dst[i].value < min_result.value || dst[i].value > max_result.value) {
+                    throw Exception(ErrorCode::ARITHMETIC_OVERFLOW_ERRROR,
+                                    "Arithmetic overflow, convert failed from {}, "
+                                    "expected data is [{}, {}]",
+                                    dst[i].value, min_result.value, max_result.value);
                 }
             }
         }
     }
+}
+
+// only for casting between other integral types and decimals
+template <typename FromDataType, typename ToDataType, bool multiply_may_overflow,
+          bool narrow_integral, typename RealFrom, typename RealTo>
+    requires IsDataTypeDecimal<FromDataType> && IsDataTypeDecimal<ToDataType>
+void convert_from_decimals(RealTo* dst, const RealFrom* src, UInt32 scale_from, size_t size) {
+    using FromFieldType = typename FromDataType::FieldType;
+    using ToFieldType = typename ToDataType::FieldType;
+    using MaxFieldType = std::conditional_t<(sizeof(FromFieldType) > sizeof(ToFieldType)),
+                                            FromFieldType, ToFieldType>;
 
-    return converted_value;
+    // from decimal to integer
+    MaxFieldType multiplier = DataTypeDecimal<MaxFieldType>::get_scale_multiplier(scale_from);
+    for (size_t i = 0; i < size; i++) {
+        dst[i] = static_cast<MaxFieldType>(src[i]).value / multiplier.value;

Review Comment:
   need to check overflow, e.g. cast decimal128 to int.



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


Re: [PR] [Improvement](decimal) reduce overhead on disable check decimal overflow [doris]

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


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


Re: [PR] test [doris]

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

   
   <details>
   <summary>TPC-H test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'</summary>
   
   ```
   Tpch sf100 test result on commit f3e7fe032790df2eb13dbe448b2dbaa6296e1109, data reload: false
   
   run tpch-sf100 query with default conf and session variables
   q1	4689	4480	4458	4458
   q2	362	155	158	155
   q3	1465	1259	1197	1197
   q4	1104	926	879	879
   q5	3095	3150	3125	3125
   q6	249	124	127	124
   q7	1028	486	466	466
   q8	2211	2246	2175	2175
   q9	6678	6769	6621	6621
   q10	3206	3238	3249	3238
   q11	331	200	207	200
   q12	345	212	210	210
   q13	4555	3900	3930	3900
   q14	238	209	228	209
   q15	576	522	533	522
   q16	446	382	400	382
   q17	1005	566	555	555
   q18	7439	7542	7069	7069
   q19	1507	1345	1436	1345
   q20	539	304	294	294
   q21	3062	2650	2688	2650
   q22	353	281	286	281
   Total cold run time: 44483 ms
   Total hot run time: 40055 ms
   
   run tpch-sf100 query with default conf and set session variable runtime_filter_mode=off
   q1	4414	4405	4376	4376
   q2	266	166	177	166
   q3	3555	3551	3531	3531
   q4	2383	2379	2367	2367
   q5	5755	5721	5753	5721
   q6	243	121	123	121
   q7	2398	1871	1875	1871
   q8	3506	3520	3519	3519
   q9	9035	8989	9002	8989
   q10	3904	3996	4003	3996
   q11	513	384	373	373
   q12	758	600	595	595
   q13	4303	3601	3509	3509
   q14	278	257	258	257
   q15	563	518	511	511
   q16	496	458	480	458
   q17	1862	1833	1872	1833
   q18	8896	8391	8279	8279
   q19	1724	1782	1753	1753
   q20	2246	1964	1938	1938
   q21	6541	6227	6172	6172
   q22	502	420	434	420
   Total cold run time: 64141 ms
   Total hot run time: 60755 ms
   ```
   </details>
   


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


Re: [PR] test [doris]

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

   
   <details>
   <summary>TPC-H test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'</summary>
   
   ```
   Tpch sf100 test result on commit e67a49dda4960e902f3d72693455ff8f6a034118, data reload: false
   
   run tpch-sf100 query with default conf and session variables
   q1	4773	4481	4485	4481
   q2	375	144	155	144
   q3	1474	1297	1251	1251
   q4	1110	929	832	832
   q5	3132	3150	3142	3142
   q6	253	130	127	127
   q7	1006	495	479	479
   q8	2204	2225	2220	2220
   q9	6648	6717	6738	6717
   q10	3199	3254	3261	3254
   q11	321	194	205	194
   q12	349	208	218	208
   q13	4564	3817	3806	3806
   q14	244	208	224	208
   q15	561	516	524	516
   q16	440	393	384	384
   q17	1009	569	508	508
   q18	7651	7606	7095	7095
   q19	1514	1278	1458	1278
   q20	524	320	297	297
   q21	3085	2676	2676	2676
   q22	351	276	283	276
   Total cold run time: 44787 ms
   Total hot run time: 40093 ms
   
   run tpch-sf100 query with default conf and set session variable runtime_filter_mode=off
   q1	4414	4425	4410	4410
   q2	270	165	175	165
   q3	3562	3596	3545	3545
   q4	2387	2389	2372	2372
   q5	5740	5745	5760	5745
   q6	240	121	121	121
   q7	2409	1879	1904	1879
   q8	3518	3523	3523	3523
   q9	9103	9014	9086	9014
   q10	3898	3954	3964	3954
   q11	497	390	409	390
   q12	765	598	599	598
   q13	4307	3529	3546	3529
   q14	280	257	258	257
   q15	565	518	519	518
   q16	498	439	469	439
   q17	1900	1868	1868	1868
   q18	8750	8258	8436	8258
   q19	1773	1752	1734	1734
   q20	2256	1957	1938	1938
   q21	6562	6226	6182	6182
   q22	504	435	415	415
   Total cold run time: 64198 ms
   Total hot run time: 60854 ms
   ```
   </details>
   


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