This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new ce75e6adfec [fix](group commit) Fix group commit debug log and improve 
performance (#38754) (#38841)
ce75e6adfec is described below

commit ce75e6adfec840519b09580434f3896b423a18b9
Author: meiyi <[email protected]>
AuthorDate: Mon Aug 5 18:34:49 2024 +0800

    [fix](group commit) Fix group commit debug log and improve performance 
(#38754) (#38841)
    
    Pick https://github.com/apache/doris/pull/38754
---
 .../org/apache/doris/analysis/NativeInsertStmt.java  | 20 ++++++++++++--------
 .../main/java/org/apache/doris/qe/StmtExecutor.java  |  6 +++---
 2 files changed, 15 insertions(+), 11 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/analysis/NativeInsertStmt.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/NativeInsertStmt.java
index ac666020a02..524b7a90a42 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/NativeInsertStmt.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/NativeInsertStmt.java
@@ -1236,8 +1236,9 @@ public class NativeInsertStmt extends InsertStmt {
                     for (Expr expr : row) {
                         if (!(expr instanceof LiteralExpr)) {
                             if (LOG.isDebugEnabled()) {
-                                LOG.debug("group commit is off for table: {}, 
because not literal expr, "
-                                        + "expr: {}, row: {}", 
targetTable.getName(), expr, row);
+                                LOG.debug("group commit is off for query_id: 
{}, table: {}, "
+                                                + "because not literal expr: 
{}, row: {}",
+                                        DebugUtil.printId(ctx.queryId()), 
targetTable.getName(), expr, row);
                             }
                             return;
                         }
@@ -1246,8 +1247,9 @@ public class NativeInsertStmt extends InsertStmt {
                 // Does not support: insert into tbl values();
                 if (selectStmt.getValueList().getFirstRow().isEmpty() && 
CollectionUtils.isEmpty(targetColumnNames)) {
                     if (LOG.isDebugEnabled()) {
-                        LOG.debug("group commit is off for table: {}, because 
first row: {}, target columns: {}",
-                                targetTable.getName(), 
selectStmt.getValueList().getFirstRow(), targetColumnNames);
+                        LOG.debug("group commit is off for query_id: {}, 
table: {}, because first row: {}, "
+                                        + "target columns: {}", 
DebugUtil.printId(ctx.queryId()), targetTable.getName(),
+                                selectStmt.getValueList().getFirstRow(), 
targetColumnNames);
                     }
                     return;
                 }
@@ -1259,8 +1261,10 @@ public class NativeInsertStmt extends InsertStmt {
                         for (SelectListItem item : items) {
                             if (item.getExpr() != null && !(item.getExpr() 
instanceof LiteralExpr)) {
                                 if (LOG.isDebugEnabled()) {
-                                    LOG.debug("group commit is off for table: 
{}, because not literal expr, "
-                                            + "expr: {}, row: {}", 
targetTable.getName(), item.getExpr(), item);
+                                    LOG.debug("group commit is off for 
query_id: {}, table: {}, "
+                                                    + "because not literal 
expr: {}, row: {}",
+                                            DebugUtil.printId(ctx.queryId()), 
targetTable.getName(), item.getExpr(),
+                                            item);
                                 }
                                 return;
                             }
@@ -1273,8 +1277,8 @@ public class NativeInsertStmt extends InsertStmt {
             if (LOG.isDebugEnabled()) {
                 for (Pair<BooleanSupplier, Supplier<String>> pair : 
conditions) {
                     if (pair.first.getAsBoolean() == false) {
-                        LOG.debug("group commit is off for table: {}, because: 
{}", targetTable.getName(),
-                                pair.second.get());
+                        LOG.debug("group commit is off for query_id: {}, 
table: {}, because: {}",
+                                DebugUtil.printId(ctx.queryId()), 
targetTable.getName(), pair.second.get());
                         break;
                     }
                 }
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java 
b/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
index dbab3ab3957..ad4ae69b36e 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
@@ -347,14 +347,14 @@ public class StmtExecutor {
             if (expr instanceof NullLiteral) {
                 row.addColBuilder().setValue(NULL_VALUE_FOR_LOAD);
             } else if (expr instanceof ArrayLiteral) {
-                row.addColBuilder().setValue(String.format("\"%s\"", 
expr.getStringValueForStreamLoad(options)));
+                row.addColBuilder().setValue("\"" + 
expr.getStringValueForStreamLoad(options) + "\"");
             } else {
                 String stringValue = expr.getStringValueForStreamLoad(options);
                 if (stringValue.equals(NULL_VALUE_FOR_LOAD) || 
stringValue.startsWith("\"") || stringValue.endsWith(
                         "\"")) {
-                    row.addColBuilder().setValue(String.format("\"%s\"", 
stringValue));
+                    row.addColBuilder().setValue("\"" + stringValue + "\"");
                 } else {
-                    row.addColBuilder().setValue(String.format("%s", 
stringValue));
+                    row.addColBuilder().setValue(stringValue);
                 }
             }
         }


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

Reply via email to