From 3448d6c84946ba1ef7a57a5524afaa4161214478 Mon Sep 17 00:00:00 2001 From: meiyi Date: Fri, 2 Aug 2024 11:30:17 +0800 Subject: [PATCH 1/2] fix format --- .../apache/doris/analysis/NativeInsertStmt.java | 15 +++++++++------ .../insert/OlapGroupCommitInsertExecutor.java | 6 ++++-- .../java/org/apache/doris/qe/StmtExecutor.java | 6 +++--- .../insert_p0/txn_insert_concurrent_insert.groovy | 2 +- 4 files changed, 17 insertions(+), 12 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 bc2ee01c58fad4..a49b474ca791af 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 @@ -1242,8 +1242,9 @@ public void analyzeGroupCommit(Analyzer analyzer) throws AnalysisException { 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, " + + "expr: {}, row: {}", DebugUtil.printId(ctx.queryId()), + targetTable.getName(), expr, row); } return; } @@ -1265,8 +1266,10 @@ public void analyzeGroupCommit(Analyzer analyzer) throws AnalysisException { 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: {}, for table: {}, " + + "because not literal expr, expr: {}, row: {}", + DebugUtil.printId(ctx.queryId()), targetTable.getName(), item.getExpr(), + item); } return; } @@ -1279,8 +1282,8 @@ public void analyzeGroupCommit(Analyzer analyzer) throws AnalysisException { if (LOG.isDebugEnabled()) { for (Pair> 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: {}, for table: {}, because: {}", + DebugUtil.printId(ctx.queryId()), targetTable.getName(), pair.second.get()); break; } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/OlapGroupCommitInsertExecutor.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/OlapGroupCommitInsertExecutor.java index 496bc161a5c711..231aecb0d85e0b 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/OlapGroupCommitInsertExecutor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/OlapGroupCommitInsertExecutor.java @@ -97,14 +97,16 @@ protected static void analyzeGroupCommit(ConnectContext ctx, TableIf table, Logi if (!ctx.isGroupCommit() && LOG.isDebugEnabled()) { for (Pair> pair : conditions) { if (pair.first.getAsBoolean() == false) { - LOG.debug("group commit is off for table: {}, because: {}", table.getName(), pair.second.get()); + LOG.debug("group commit is off for query_id: {}, for table: {}, because: {}", + DebugUtil.printId(ctx.queryId()), table.getName(), pair.second.get()); break; } } } } else { if (LOG.isDebugEnabled()) { - LOG.debug("group commit is off because for table: {}, because logicalQuery class: {}", table.getName(), + LOG.debug("group commit is off for query_id: {}, because for table: {}, because " + + "logicalQuery class: {}", DebugUtil.printId(ctx.queryId()), table.getName(), logicalQuery.getClass().getName()); } } 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 adb8ecf61bf3b9..e39fb1557fff30 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 @@ -366,14 +366,14 @@ public static InternalService.PDataRow getRowStringValue(List cols, 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); } } } diff --git a/regression-test/suites/insert_p0/txn_insert_concurrent_insert.groovy b/regression-test/suites/insert_p0/txn_insert_concurrent_insert.groovy index c28f9192258120..e520d0b9d953d1 100644 --- a/regression-test/suites/insert_p0/txn_insert_concurrent_insert.groovy +++ b/regression-test/suites/insert_p0/txn_insert_concurrent_insert.groovy @@ -109,7 +109,7 @@ suite("txn_insert_concurrent_insert") { futures.add(future) } CompletableFuture[] futuresArray = futures.toArray(new CompletableFuture[0]) - CompletableFuture.allOf(futuresArray).get(3, TimeUnit.MINUTES) + CompletableFuture.allOf(futuresArray).get(10, TimeUnit.MINUTES) sql """ sync """ def result = sql """ select count() from ${tableName}_0 """ From ec25008eb0dff8397e7b8a60e155f6d41e505ea5 Mon Sep 17 00:00:00 2001 From: meiyi Date: Fri, 2 Aug 2024 11:38:48 +0800 Subject: [PATCH 2/2] fix format --- .../apache/doris/analysis/NativeInsertStmt.java | 17 +++++++++-------- .../insert/OlapGroupCommitInsertExecutor.java | 7 +++---- 2 files changed, 12 insertions(+), 12 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 a49b474ca791af..ae3c2371e73c01 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 @@ -1242,9 +1242,9 @@ public void analyzeGroupCommit(Analyzer analyzer) throws AnalysisException { for (Expr expr : row) { if (!(expr instanceof LiteralExpr)) { if (LOG.isDebugEnabled()) { - LOG.debug("group commit is off for query_id: {}, table: {}, because not literal expr, " - + "expr: {}, row: {}", DebugUtil.printId(ctx.queryId()), - 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; } @@ -1253,8 +1253,9 @@ public void analyzeGroupCommit(Analyzer analyzer) throws AnalysisException { // 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; } @@ -1266,8 +1267,8 @@ public void analyzeGroupCommit(Analyzer analyzer) throws AnalysisException { for (SelectListItem item : items) { if (item.getExpr() != null && !(item.getExpr() instanceof LiteralExpr)) { if (LOG.isDebugEnabled()) { - LOG.debug("group commit is off for query_id: {}, for table: {}, " - + "because not literal expr, expr: {}, row: {}", + LOG.debug("group commit is off for query_id: {}, table: {}, " + + "because not literal expr: {}, row: {}", DebugUtil.printId(ctx.queryId()), targetTable.getName(), item.getExpr(), item); } @@ -1282,7 +1283,7 @@ public void analyzeGroupCommit(Analyzer analyzer) throws AnalysisException { if (LOG.isDebugEnabled()) { for (Pair> pair : conditions) { if (pair.first.getAsBoolean() == false) { - LOG.debug("group commit is off for query_id: {}, for table: {}, because: {}", + 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/nereids/trees/plans/commands/insert/OlapGroupCommitInsertExecutor.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/OlapGroupCommitInsertExecutor.java index 231aecb0d85e0b..a44528e93b379d 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/OlapGroupCommitInsertExecutor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/OlapGroupCommitInsertExecutor.java @@ -97,7 +97,7 @@ protected static void analyzeGroupCommit(ConnectContext ctx, TableIf table, Logi if (!ctx.isGroupCommit() && LOG.isDebugEnabled()) { for (Pair> pair : conditions) { if (pair.first.getAsBoolean() == false) { - LOG.debug("group commit is off for query_id: {}, for table: {}, because: {}", + LOG.debug("group commit is off for query_id: {}, table: {}, because: {}", DebugUtil.printId(ctx.queryId()), table.getName(), pair.second.get()); break; } @@ -105,9 +105,8 @@ protected static void analyzeGroupCommit(ConnectContext ctx, TableIf table, Logi } } else { if (LOG.isDebugEnabled()) { - LOG.debug("group commit is off for query_id: {}, because for table: {}, because " - + "logicalQuery class: {}", DebugUtil.printId(ctx.queryId()), table.getName(), - logicalQuery.getClass().getName()); + LOG.debug("group commit is off for query_id: {}, table: {}, because logicalQuery class: {}", + DebugUtil.printId(ctx.queryId()), table.getName(), logicalQuery.getClass().getName()); } } }