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

[GitHub] [doris] yiguolei opened a new pull request, #16141: [refactor](remove non vec code) remove json functions string functions match functions and some code

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

   # Proposed changes
   
   1. remove json functions code
   2. remove string functions code
   3. remove math functions code
   4. move MatchPredicate to olap since it is only used in storage predicate process
   5. remove some code in tuple, Tuple structure should be removed in the future.
   6. remove many code in collection value structure, they are useless
   
   ## Problem summary
   
   Describe your changes.
   
   ## Checklist(Required)
   
   1. Does it affect the original behavior: 
       - [ ] Yes
       - [ ] No
       - [ ] I don't know
   7. Has unit tests been added:
       - [ ] Yes
       - [ ] No
       - [ ] No Need
   8. Has document been added or modified:
       - [ ] Yes
       - [ ] No
       - [ ] No Need
   9. Does it need to update dependencies:
       - [ ] Yes
       - [ ] No
   10. Are there any changes that cannot be rolled back:
       - [ ] Yes (If Yes, please explain WHY)
       - [ ] No
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

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


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


[GitHub] [doris] github-actions[bot] commented on pull request #16141: [refactor](remove non vec code) remove json functions string functions match functions and some code

Posted by github-actions.
github-actions[bot] commented on PR #16141:
URL: https://github.com/apache/doris/pull/16141#issuecomment-1404585581

   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


[GitHub] [doris] hello-stephen commented on pull request #16141: [refactor](remove non vec code) remove json functions string functions match functions and some code

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

   TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 34.87 seconds
    load time: 499 seconds
    storage size: 17119089161 Bytes
    https://doris-community-test-1308700295.cos.ap-hongkong.myqcloud.com/tmp/20230126062719_clickbench_pr_85212.html


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

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


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


[GitHub] [doris] github-actions[bot] commented on a diff in pull request #16141: [refactor](remove non vec code) remove json functions string functions match functions and some code

Posted by github-actions.
github-actions[bot] commented on code in PR #16141:
URL: https://github.com/apache/doris/pull/16141#discussion_r1087455603


##########
be/src/vec/functions/function_string.h:
##########
@@ -1949,6 +1949,45 @@ class FunctionMoneyFormat : public IFunction {
     }
 };
 
+namespace MoneyFormat {
+
+template <typename T, size_t N>
+static StringVal do_money_format(FunctionContext* context, const T int_value,
+                                 const int32_t frac_value = 0) {
+    char local[N];
+    char* p = SimpleItoaWithCommas(int_value, local, sizeof(local));
+    int32_t string_val_len = local + sizeof(local) - p + 3;
+    StringVal result = StringVal::create_temp_string_val(context, string_val_len);
+    memcpy(result.ptr, p, string_val_len - 3);
+    *(result.ptr + string_val_len - 3) = '.';
+    *(result.ptr + string_val_len - 2) = '0' + (frac_value / 10);
+    *(result.ptr + string_val_len - 1) = '0' + (frac_value % 10);
+    return result;
+};
+
+// Note string value must be valid decimal string which contains two digits after the decimal point
+static StringVal do_money_format(FunctionContext* context, const string& value) {
+    bool is_positive = (value[0] != '-');
+    int32_t result_len = value.size() + (value.size() - (is_positive ? 4 : 5)) / 3;
+    StringVal result = StringVal::create_temp_string_val(context, result_len);
+    if (!is_positive) {
+        *result.ptr = '-';
+    }
+    for (int i = value.size() - 4, j = result_len - 4; i >= 0; i = i - 3, j = j - 4) {
+        *(result.ptr + j) = *(value.data() + i);
+        if (i - 1 < 0) break;

Review Comment:
   warning: statement should be inside braces [readability-braces-around-statements]
   
   ```suggestion
           if (i - 1 < 0) { break;
   }
   ```
   



##########
be/src/vec/functions/function_string.h:
##########
@@ -1949,6 +1949,45 @@
     }
 };
 
+namespace MoneyFormat {
+
+template <typename T, size_t N>
+static StringVal do_money_format(FunctionContext* context, const T int_value,
+                                 const int32_t frac_value = 0) {
+    char local[N];
+    char* p = SimpleItoaWithCommas(int_value, local, sizeof(local));
+    int32_t string_val_len = local + sizeof(local) - p + 3;
+    StringVal result = StringVal::create_temp_string_val(context, string_val_len);
+    memcpy(result.ptr, p, string_val_len - 3);
+    *(result.ptr + string_val_len - 3) = '.';
+    *(result.ptr + string_val_len - 2) = '0' + (frac_value / 10);
+    *(result.ptr + string_val_len - 1) = '0' + (frac_value % 10);
+    return result;
+};
+
+// Note string value must be valid decimal string which contains two digits after the decimal point
+static StringVal do_money_format(FunctionContext* context, const string& value) {
+    bool is_positive = (value[0] != '-');
+    int32_t result_len = value.size() + (value.size() - (is_positive ? 4 : 5)) / 3;
+    StringVal result = StringVal::create_temp_string_val(context, result_len);
+    if (!is_positive) {
+        *result.ptr = '-';
+    }
+    for (int i = value.size() - 4, j = result_len - 4; i >= 0; i = i - 3, j = j - 4) {
+        *(result.ptr + j) = *(value.data() + i);
+        if (i - 1 < 0) break;
+        *(result.ptr + j - 1) = *(value.data() + i - 1);
+        if (i - 2 < 0) break;

Review Comment:
   warning: statement should be inside braces [readability-braces-around-statements]
   
   ```suggestion
           if (i - 2 < 0) { break;
   }
   ```
   



##########
be/test/testutil/array_utils.cpp:
##########
@@ -38,19 +37,6 @@ void ArrayUtils::prepare_context(FunctionContext& context, MemPool& mem_pool,
     context.impl()->_pool = new FreePool(&mem_pool);

Review Comment:
   warning: '_pool' is a private member of 'doris::FunctionContextImpl' [clang-diagnostic-error]
   ```cpp
       context.impl()->_pool = new FreePool(&mem_pool);
                       ^
   ```
   **be/src/udf/udf_internal.h:136:** declared private here
   ```cpp
       FreePool* _pool;
                 ^
   ```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

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


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


[GitHub] [doris] github-actions[bot] commented on pull request #16141: [refactor](remove non vec code) remove json functions string functions match functions and some code

Posted by github-actions.
github-actions[bot] commented on PR #16141:
URL: https://github.com/apache/doris/pull/16141#issuecomment-1404585593

   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


[GitHub] [doris] yiguolei merged pull request #16141: [refactor](remove non vec code) remove json functions string functions match functions and some code

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


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