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


##########
be/src/vec/exprs/vcolumn_ref.h:
##########
@@ -16,6 +16,8 @@
 // under the License.
 
 #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/exprs/vcolumn_ref.h:
##########
@@ -67,11 +69,13 @@
 
     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(fmt::memory_buffer& out) const override {

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



##########
be/src/vec/exprs/vlambda_function_call_expr.h:
##########
@@ -67,22 +67,26 @@ 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;
-        out << "VLambdaFunctionCallExpr[";
-        out << _expr_name;
-        out << "]{";
+    void debug_string(fmt::memory_buffer& out) const override {

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



##########
be/src/vec/exprs/vexpr.cpp:
##########
@@ -475,15 +475,24 @@
 }
 
 std::string VExpr::debug_string() const {
-    // TODO: implement partial debug string for member vars
-    std::stringstream out;
-    out << " type=" << _type.debug_string();
+    fmt::memory_buffer out;
+    debug_string(out);
+    return fmt::to_string(out);
+}
 
+void VExpr::debug_string(fmt::memory_buffer& out) const {
+    if (check_string_over_limit(out)) {
+        return;
+    }
+    fmt::format_to(out, " type={}", _type.debug_string());
     if (!_children.empty()) {
-        out << " children=" << debug_string(_children);
+        fmt::format_to(out, " children=");
+        debug_string(_children, out);
     }
+}
 
-    return out.str();
+bool VExpr::check_string_over_limit(fmt::memory_buffer& 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(fmt::memory_buffer& out) {
   ```
   



##########
be/src/vec/exprs/vexpr.cpp:
##########
@@ -506,6 +515,19 @@
     return debug_string(exprs);
 }
 
+void VExpr::debug_string(const VExprSPtrs& exprs, fmt::memory_buffer& 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, fmt::memory_buffer& 
out) {
   ```
   



##########
be/src/vec/exprs/vectorized_fn_call.cpp:
##########
@@ -213,31 +213,36 @@ const std::string& VectorizedFnCall::expr_name() const {
     return _expr_name;
 }
 
-std::string VectorizedFnCall::debug_string() const {
-    std::stringstream out;
-    out << "VectorizedFn[";
-    out << _expr_name;
-    out << "]{";
+void VectorizedFnCall::debug_string(fmt::memory_buffer& out) const {

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



##########
be/src/vec/exprs/vcase_expr.cpp:
##########
@@ -125,20 +126,25 @@ const std::string& VCaseExpr::expr_name() const {
     return _expr_name;
 }
 
-std::string VCaseExpr::debug_string() const {
-    std::stringstream out;
-    out << "CaseExpr(has_case_expr=" << _has_case_expr << " has_else_expr=" << 
_has_else_expr
-        << " function=" << _function_name << "){";
+void VCaseExpr::debug_string(fmt::memory_buffer& out) const {

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



##########
be/src/vec/exprs/vcast_expr.cpp:
##########
@@ -129,20 +129,25 @@ const std::string& VCastExpr::expr_name() const {
     return _expr_name;
 }
 
-std::string VCastExpr::debug_string() const {
-    std::stringstream out;
-    out << "CastExpr(CAST " << _cast_param_data_type->get_name() << " to "
-        << _target_data_type->get_name() << "){";
+void VCastExpr::debug_string(fmt::memory_buffer& out) const {

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



##########
be/src/vec/exprs/vexpr.cpp:
##########
@@ -475,15 +475,24 @@ 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;
-    out << " type=" << _type.debug_string();
+    fmt::memory_buffer out;
+    debug_string(out);
+    return fmt::to_string(out);
+}
 
+void VExpr::debug_string(fmt::memory_buffer& out) const {

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



##########
be/src/vec/exprs/vbitmap_predicate.h:
##########
@@ -66,9 +66,12 @@ class VBitmapPredicate final : public VExpr {
         return _filter;
     }
 
-    std::string debug_string() const override {
-        return fmt::format(" VBitmapPredicate:{}", VExpr::debug_string());
-    }
+    void debug_string(fmt::memory_buffer& out) const override {

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



##########
be/src/vec/exprs/vtuple_is_null_predicate.cpp:
##########
@@ -70,12 +71,11 @@ const std::string& VTupleIsNullPredicate::expr_name() const 
{
     return _expr_name;
 }
 
-std::string VTupleIsNullPredicate::debug_string() const {
-    std::stringstream out;
-    out << "TupleIsNullPredicate(_column_to_check=[";
-    out << _column_to_check;
-    out << "])";
-    return out.str();
+void VTupleIsNullPredicate::debug_string(fmt::memory_buffer& out) const {

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



##########
be/src/vec/exprs/vin_predicate.cpp:
##########
@@ -126,17 +126,23 @@ const std::string& VInPredicate::expr_name() const {
     return _expr_name;
 }
 
-std::string VInPredicate::debug_string() const {
-    std::stringstream out;
-    out << "InPredicate(" << children()[0]->debug_string() << " " << 
_is_not_in << ",[";
+void VInPredicate::debug_string(fmt::memory_buffer& out) const {

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



##########
be/src/vec/exprs/vmatch_predicate.cpp:
##########
@@ -149,17 +149,24 @@ 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(fmt::memory_buffer& out) const {

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



##########
be/src/vec/exprs/vslot_ref.cpp:
##########
@@ -99,9 +100,12 @@ Status VSlotRef::execute(VExprContext* context, Block* 
block, int* result_column
 const std::string& VSlotRef::expr_name() const {
     return *_column_name;
 }
-std::string VSlotRef::debug_string() const {
-    std::stringstream out;
-    out << "SlotRef(slot_id=" << _slot_id << VExpr::debug_string() << ")";
-    return out.str();
+void VSlotRef::debug_string(fmt::memory_buffer& out) const {

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



##########
be/src/vec/exprs/vruntimefilter_wrapper.h:
##########
@@ -50,7 +50,12 @@ class VRuntimeFilterWrapper final : public VExpr {
     Status prepare(RuntimeState* state, const RowDescriptor& desc, 
VExprContext* context) override;
     Status open(RuntimeState* state, VExprContext* context,
                 FunctionContext::FunctionStateScope scope) override;
-    std::string debug_string() const override { return _impl->debug_string(); }
+    void debug_string(fmt::memory_buffer& out) const override {

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



##########
be/src/vec/exprs/vliteral.cpp:
##########
@@ -87,13 +87,12 @@ std::string VLiteral::value() const {
     return out.str();
 }
 
-std::string VLiteral::debug_string() const {
-    std::stringstream out;
-    out << "VLiteral (name = " << _expr_name;
-    out << ", type = " << _data_type->get_name();
-    out << ", value = (" << value();
-    out << "))";
-    return out.str();
+void VLiteral::debug_string(fmt::memory_buffer& out) const {

Review Comment:
   warning: method 'debug_string' can be made static 
[readability-convert-member-functions-to-static]
   
   ```suggestion
   static void VLiteral::debug_string(fmt::memory_buffer& 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: 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

Reply via email to