pick (#40037)
This commit is contained in:
@ -347,7 +347,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.
|
||||
|
||||
@ -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-_]*$";
|
||||
|
||||
Reference in New Issue
Block a user