morrySnow commented on code in PR #44755:
URL: https://github.com/apache/doris/pull/44755#discussion_r1924760996
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java:
##########
@@ -864,41 +864,38 @@ public LogicalPlan
visitCreateScheduledJob(DorisParser.CreateScheduledJobContext
return new CreateJobCommand(createJobInfo);
}
+ private void checkJobNameKey(String key, String keyFormat,
DorisParser.SupportedJobStatementContext parseContext) {
+ if (key.isEmpty() || !key.equalsIgnoreCase(keyFormat)) {
+ throw new ParseException(keyFormat + " should be: '" + keyFormat +
"'", parseContext);
+ }
+ }
+
@Override
public LogicalPlan visitPauseJob(DorisParser.PauseJobContext ctx) {
- Expression wildWhere = null;
- if (ctx.wildWhere() != null) {
- wildWhere = getWildWhere(ctx.wildWhere());
- }
- return new PauseJobCommand(wildWhere);
+ checkJobNameKey(stripQuotes(ctx.jobNameKey.getText()), "jobName", ctx);
Review Comment:
not use magic word, let `"jobName"` be a static variable.
```suggestion
private static String JOB_NAME = "jobName";
...
checkJobNameKey(stripQuotes(ctx.jobNameKey.getText()), JOB_NAME,
ctx);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]