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

morrysnow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 3d47e2e1208 [chore](mtmv)Optimize mtmv logs and exception information 
(#34957)
3d47e2e1208 is described below

commit 3d47e2e12088e3e5d7f18eba5cb2439238f06676
Author: zhangdong <493738...@qq.com>
AuthorDate: Fri May 17 11:14:19 2024 +0800

    [chore](mtmv)Optimize mtmv logs and exception information (#34957)
    
    1. Change some logs to debug.
    2. Error prompt changed from MTMV to async materialized view
---
 .../org/apache/doris/alter/AlterOperations.java    |  2 +-
 .../apache/doris/job/extensions/mtmv/MTMVTask.java | 24 ++++++++++++++++------
 .../doris/mtmv/MTMVPartitionExprDateTrunc.java     |  3 ++-
 .../doris/mtmv/MTMVPartitionExprFactory.java       |  4 ++--
 ...MTMVRelatedPartitionDescSyncLimitGenerator.java |  3 ++-
 .../trees/plans/commands/info/CreateMTMVInfo.java  |  2 +-
 .../tablefunction/MvInfosTableValuedFunction.java  |  2 +-
 7 files changed, 27 insertions(+), 13 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/alter/AlterOperations.java 
b/fe/fe-core/src/main/java/org/apache/doris/alter/AlterOperations.java
index f7ce1ea56f4..ba5175b6fa9 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/alter/AlterOperations.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/alter/AlterOperations.java
@@ -51,7 +51,7 @@ public class AlterOperations {
     public void checkMTMVAllow(List<AlterClause> alterClauses) throws 
DdlException {
         for (AlterClause alterClause : alterClauses) {
             if (!(alterClause.allowOpMTMV())) {
-                throw new DdlException("Not allowed to perform current 
operation on MTMV");
+                throw new DdlException("Not allowed to perform current 
operation on async materialized view");
             }
         }
     }
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/job/extensions/mtmv/MTMVTask.java 
b/fe/fe-core/src/main/java/org/apache/doris/job/extensions/mtmv/MTMVTask.java
index 7a4c5277591..4bb10017e71 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/job/extensions/mtmv/MTMVTask.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/job/extensions/mtmv/MTMVTask.java
@@ -154,7 +154,9 @@ public class MTMVTask extends AbstractTask {
 
     @Override
     public void run() throws JobException {
-        LOG.info("mtmv task run, taskId: {}", super.getTaskId());
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("mtmv task run, taskId: {}", super.getTaskId());
+        }
         ConnectContext ctx = MTMVPlanUtil.createMTMVContext(mtmv);
         try {
             if (LOG.isDebugEnabled()) {
@@ -246,7 +248,9 @@ public class MTMVTask extends AbstractTask {
 
     @Override
     public synchronized void onSuccess() throws JobException {
-        LOG.info("mtmv task onSuccess, taskId: {}", super.getTaskId());
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("mtmv task onSuccess, taskId: {}", super.getTaskId());
+        }
         super.onSuccess();
         after();
     }
@@ -262,7 +266,9 @@ public class MTMVTask extends AbstractTask {
 
     @Override
     public void before() throws JobException {
-        LOG.info("mtmv task before, taskId: {}", super.getTaskId());
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("mtmv task before, taskId: {}", super.getTaskId());
+        }
         super.before();
         try {
             mtmv = MTMVUtil.getMTMV(dbId, mtmvId);
@@ -295,13 +301,19 @@ public class MTMVTask extends AbstractTask {
         LOG.info("mtmv task runTask, taskId: {}", super.getTaskId());
         MTMVJob job = (MTMVJob) getJobOrJobException();
         try {
-            LOG.info("mtmv task get writeLock start, taskId: {}", 
super.getTaskId());
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("mtmv task get writeLock start, taskId: {}", 
super.getTaskId());
+            }
             job.writeLock();
-            LOG.info("mtmv task get writeLock end, taskId: {}", 
super.getTaskId());
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("mtmv task get writeLock end, taskId: {}", 
super.getTaskId());
+            }
             super.runTask();
         } finally {
             job.writeUnlock();
-            LOG.info("mtmv task release writeLock, taskId: {}", 
super.getTaskId());
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("mtmv task release writeLock, taskId: {}", 
super.getTaskId());
+            }
         }
     }
 
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVPartitionExprDateTrunc.java
 
b/fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVPartitionExprDateTrunc.java
index e1991ab2921..a42fae22585 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVPartitionExprDateTrunc.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVPartitionExprDateTrunc.java
@@ -203,7 +203,8 @@ public class MTMVPartitionExprDateTrunc implements 
MTMVPartitionExprService {
                 result = value.plusDays(1L);
                 break;
             default:
-                throw new AnalysisException("MTMV partition roll up not 
support timeUnit: " + timeUnit);
+                throw new AnalysisException(
+                        "async materialized view partition roll up not support 
timeUnit: " + timeUnit);
         }
         if (!(result instanceof DateTimeV2Literal)) {
             throw new AnalysisException("sub() should return  DateTimeLiteral, 
result: " + result);
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVPartitionExprFactory.java 
b/fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVPartitionExprFactory.java
index 0fc9a067fad..1093399450d 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVPartitionExprFactory.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVPartitionExprFactory.java
@@ -27,13 +27,13 @@ import org.apache.doris.common.AnalysisException;
 public class MTMVPartitionExprFactory {
     public static MTMVPartitionExprService getExprService(Expr expr) throws 
AnalysisException {
         if (!(expr instanceof FunctionCallExpr)) {
-            throw new AnalysisException("now mtmv partition only support 
FunctionCallExpr");
+            throw new AnalysisException("now async materialized view partition 
only support FunctionCallExpr");
         }
         FunctionCallExpr functionCallExpr = (FunctionCallExpr) expr;
         String fnName = 
functionCallExpr.getFnName().getFunction().toLowerCase();
         if ("date_trunc".equals(fnName)) {
             return new MTMVPartitionExprDateTrunc(functionCallExpr);
         }
-        throw new AnalysisException("MTMV partition not support function name: 
" + fnName);
+        throw new AnalysisException("async materialized view partition not 
support function name: " + fnName);
     }
 }
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVRelatedPartitionDescSyncLimitGenerator.java
 
b/fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVRelatedPartitionDescSyncLimitGenerator.java
index e031071192e..36e46b0e80b 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVRelatedPartitionDescSyncLimitGenerator.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVRelatedPartitionDescSyncLimitGenerator.java
@@ -132,7 +132,8 @@ public class MTMVRelatedPartitionDescSyncLimitGenerator 
implements MTMVRelatedPa
                 result = DateTimeArithmetic.monthsSub(date, integerLiteral);
                 break;
             default:
-                throw new AnalysisException("MTMV partition limit not support 
timeUnit: " + timeUnit.name());
+                throw new AnalysisException(
+                        "async materialized view partition limit not support 
timeUnit: " + timeUnit.name());
         }
         if (!(result instanceof DateTimeLiteral)) {
             throw new AnalysisException("sub() should return  DateTimeLiteral, 
result: " + result);
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CreateMTMVInfo.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CreateMTMVInfo.java
index 38e3ab718ba..b64ad88e154 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CreateMTMVInfo.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CreateMTMVInfo.java
@@ -157,7 +157,7 @@ public class CreateMTMVInfo {
         columns.forEach(c -> c.validate(true, keysSet, 
finalEnableMergeOnWrite, KeysType.DUP_KEYS));
 
         if (distribution == null) {
-            throw new AnalysisException("Create MTMV should contain 
distribution desc");
+            throw new AnalysisException("Create async materialized view should 
contain distribution desc");
         }
 
         if (properties == null) {
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/tablefunction/MvInfosTableValuedFunction.java
 
b/fe/fe-core/src/main/java/org/apache/doris/tablefunction/MvInfosTableValuedFunction.java
index fbc414e717f..4135173c34a 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/tablefunction/MvInfosTableValuedFunction.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/tablefunction/MvInfosTableValuedFunction.java
@@ -92,7 +92,7 @@ public class MvInfosTableValuedFunction extends 
MetadataTableValuedFunction {
         }
         String dbName = validParams.get(DB);
         if (dbName == null) {
-            throw new AnalysisException("Invalid mtmv metadata query");
+            throw new AnalysisException("Invalid async materialized view 
metadata query");
         }
         this.databaseName = dbName;
         if (LOG.isDebugEnabled()) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to