github-actions[bot] commented on code in PR #28395: URL: https://github.com/apache/doris/pull/28395#discussion_r1427522692
########## be/src/vec/exprs/vcase_expr.cpp: ########## @@ -117,20 +117,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/vcast_expr.cpp: ########## @@ -130,20 +130,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: ########## @@ -467,6 +486,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/vlambda_function_call_expr.h: ########## @@ -57,8 +57,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/vmatch_predicate.cpp: ########## @@ -146,17 +146,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/vectorized_fn_call.cpp: ########## @@ -198,8 +198,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) { ``` ########## be/src/vec/exprs/vexpr.cpp: ########## @@ -438,13 +438,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/vexpr.cpp: ########## @@ -438,13 +438,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/vcolumn_ref.h: ########## @@ -57,11 +57,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 { ``` -- 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-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org