You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by da...@apache.org on 2024/09/07 15:49:15 UTC

(doris) branch branch-2.0 updated: [chore](routine load) make error msg clear if routine load name illegal (#40037) (#40499)

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

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


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new 3192b7f8d07 [chore](routine load)  make error msg clear if routine load name illegal (#40037) (#40499)
3192b7f8d07 is described below

commit 3192b7f8d071708b5971e7b7ca8ab5d7f8fad6a4
Author: hui lai <13...@qq.com>
AuthorDate: Sat Sep 7 23:49:08 2024 +0800

    [chore](routine load)  make error msg clear if routine load name illegal (#40037) (#40499)
    
    pick (#40037)
---
 .../java/org/apache/doris/analysis/CreateRoutineLoadStmt.java    | 9 ++++++++-
 .../src/main/java/org/apache/doris/common/FeNameFormat.java      | 2 ++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/CreateRoutineLoadStmt.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/CreateRoutineLoadStmt.java
index 0e2ed01c6c2..3be1e049b5c 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/CreateRoutineLoadStmt.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/CreateRoutineLoadStmt.java
@@ -335,7 +335,14 @@ public class CreateRoutineLoadStmt extends DdlStmt {
         // check dbName and tableName
         checkDBTable(analyzer);
         // check name
-        FeNameFormat.checkCommonName(NAME_TYPE, name);
+        try {
+            FeNameFormat.checkCommonName(NAME_TYPE, name);
+        } catch (AnalysisException e) {
+            // 64 is the length of regular expression matching
+            // (FeNameFormat.COMMON_NAME_REGEX/UNDERSCORE_COMMON_NAME_REGEX)
+            throw new AnalysisException(e.getMessage()
+                    + " Maybe routine load job name is longer than 64 or contains illegal characters");
+        }
         // check load properties include column separator etc.
         checkLoadProperties();
         // check routine load job properties include desired concurrent number etc.
diff --git a/fe/fe-core/src/main/java/org/apache/doris/common/FeNameFormat.java b/fe/fe-core/src/main/java/org/apache/doris/common/FeNameFormat.java
index e21cbe7b112..aa0fb7ec289 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/common/FeNameFormat.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/common/FeNameFormat.java
@@ -29,6 +29,8 @@ import com.google.common.base.Strings;
 
 public class FeNameFormat {
     private static final String LABEL_REGEX = "^[-_A-Za-z0-9:]{1," + Config.label_regex_length + "}$";
+    // if modify the matching length of a regular expression,
+    // please modify error msg when FeNameFormat.checkCommonName throw exception in CreateRoutineLoadStmt
     private static final String COMMON_NAME_REGEX = "^[a-zA-Z][a-zA-Z0-9-_]{0,63}$";
     private static final String UNDERSCORE_COMMON_NAME_REGEX = "^[_a-zA-Z][a-zA-Z0-9-_]{0,63}$";
     private static final String TABLE_NAME_REGEX = "^[a-zA-Z][a-zA-Z0-9-_]*$";


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