github-actions[bot] commented on code in PR #30464:
URL: https://github.com/apache/doris/pull/30464#discussion_r1468448002


##########
be/src/vec/exprs/vcase_expr.cpp:
##########
@@ -125,20 +125,21 @@ const std::string& VCaseExpr::expr_name() const {
     return _expr_name;
 }
 
-std::string VCaseExpr::debug_string() const {
-    std::stringstream out;
+void VCaseExpr::debug_string(std::stringstream& out) const {

Review Comment:
   warning: method 'debug_string' can be made static 
[readability-convert-member-functions-to-static]
   
   ```suggestion
   static void VCaseExpr::debug_string(std::stringstream& out) {
   ```
   



##########
be/src/vec/exprs/vexpr.cpp:
##########
@@ -441,13 +441,32 @@ Status VExpr::clone_if_not_exists(const 
VExprContextSPtrs& ctxs, RuntimeState* s
 std::string VExpr::debug_string() const {
     // TODO: implement partial debug string for member vars
     std::stringstream out;
+    debug_string(out);
+    return std::move(out).str();
+}
+
+void VExpr::debug_string(std::stringstream& out) const {

Review Comment:
   warning: method 'debug_string' can be made static 
[readability-convert-member-functions-to-static]
   
   ```suggestion
   static void VExpr::debug_string(std::stringstream& out) {
   ```
   



##########
be/src/vec/exprs/vexpr.cpp:
##########
@@ -441,13 +441,32 @@
 std::string VExpr::debug_string() const {
     // TODO: implement partial debug string for member vars
     std::stringstream out;
+    debug_string(out);
+    return std::move(out).str();
+}
+
+void VExpr::debug_string(std::stringstream& out) const {
+    if (check_string_over_limit(out)) {
+        return;
+    }
     out << " type=" << _type.debug_string();
 
     if (!_children.empty()) {
-        out << " children=" << debug_string(_children);
+        out << " children=";
+        debug_string(_children, out);
     }
+}
 
-    return out.str();
+bool VExpr::check_string_over_limit(std::stringstream& out) {

Review Comment:
   warning: method 'check_string_over_limit' can be made static 
[readability-convert-member-functions-to-static]
   
   ```suggestion
   static bool VExpr::check_string_over_limit(std::stringstream& out) {
   ```
   



##########
be/src/vec/exprs/vmatch_predicate.cpp:
##########
@@ -149,17 +149,21 @@ const std::string& VMatchPredicate::function_name() const 
{
     return _function_name;
 }
 
-std::string VMatchPredicate::debug_string() const {
-    std::stringstream out;
-    out << "MatchPredicate(" << children()[0]->debug_string() << ",[";
+void VMatchPredicate::debug_string(std::stringstream& out) const {

Review Comment:
   warning: method 'debug_string' can be made static 
[readability-convert-member-functions-to-static]
   
   ```suggestion
   static void VMatchPredicate::debug_string(std::stringstream& out) {
   ```
   



##########
be/src/vec/exprs/vcolumn_ref.h:
##########
@@ -67,11 +67,13 @@ class VColumnRef final : public VExpr {
 
     const std::string& expr_name() const override { return _column_name; }
 
-    std::string debug_string() const override {
-        std::stringstream out;
-        out << "VColumnRef(slot_id: " << _column_id << ",column_name: " << 
_column_name
-            << VExpr::debug_string() << ")";
-        return out.str();
+    void debug_string(std::stringstream& out) const override {

Review Comment:
   warning: method 'debug_string' can be made static 
[readability-convert-member-functions-to-static]
   
   ```suggestion
       static void debug_string(std::stringstream& out) override {
   ```
   



##########
be/src/vec/exprs/vlambda_function_call_expr.h:
##########
@@ -67,8 +67,10 @@ class VLambdaFunctionCallExpr : public VExpr {
         return _lambda_function->execute(context, block, result_column_id, 
_data_type, _children);
     }
 
-    std::string debug_string() const override {
-        std::stringstream out;
+    void debug_string(std::stringstream& out) const override {

Review Comment:
   warning: method 'debug_string' can be made static 
[readability-convert-member-functions-to-static]
   
   ```suggestion
       static void debug_string(std::stringstream& out) override {
   ```
   



##########
be/src/vec/exprs/vcast_expr.cpp:
##########
@@ -129,20 +129,21 @@ const std::string& VCastExpr::expr_name() const {
     return _expr_name;
 }
 
-std::string VCastExpr::debug_string() const {
-    std::stringstream out;
+void VCastExpr::debug_string(std::stringstream& out) const {

Review Comment:
   warning: method 'debug_string' can be made static 
[readability-convert-member-functions-to-static]
   
   ```suggestion
   static void VCastExpr::debug_string(std::stringstream& out) {
   ```
   



##########
be/src/vec/exprs/vexpr.cpp:
##########
@@ -470,6 +489,16 @@
     return debug_string(exprs);
 }
 
+void VExpr::debug_string(const VExprSPtrs& exprs, std::stringstream& out) {

Review Comment:
   warning: method 'debug_string' can be made static 
[readability-convert-member-functions-to-static]
   
   ```suggestion
   static void VExpr::debug_string(const VExprSPtrs& exprs, std::stringstream& 
out) {
   ```
   



##########
be/src/vec/exprs/vectorized_fn_call.cpp:
##########
@@ -203,8 +203,10 @@ const std::string& VectorizedFnCall::expr_name() const {
     return _expr_name;
 }
 
-std::string VectorizedFnCall::debug_string() const {
-    std::stringstream out;
+void VectorizedFnCall::debug_string(std::stringstream& out) const {

Review Comment:
   warning: method 'debug_string' can be made static 
[readability-convert-member-functions-to-static]
   
   ```suggestion
   static void VectorizedFnCall::debug_string(std::stringstream& out) {
   ```
   



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to