link3280 commented on code in PR #20159: URL: https://github.com/apache/flink/pull/20159#discussion_r928106727
########## flink-table/flink-sql-parser/src/main/codegen/includes/parserImpls.ftl: ########## @@ -2296,3 +2296,38 @@ SqlNode SqlAnalyzeTable(): return new SqlAnalyzeTable(s.end(this), tableName, partitionSpec, columns, allColumns); } } + +/** +* Parses a STOP JOB statement: +* STOP JOB <JOB_ID> [<WITH SAVEPOINT>] [<WITH DRAIN>]; +*/ +SqlStopJob SqlStopJob() : +{ + SqlCharStringLiteral jobId; + boolean isWithSavepoint = false; + boolean isWithDrain = false; +} +{ + <STOP> <JOB> <QUOTED_STRING> + { + String id = SqlParserUtil.parseString(token.image); + jobId = SqlLiteral.createCharString(id, getPos()); + } + [ + LOOKAHEAD(2) + <WITH> <SAVEPOINT> Review Comment: I've reconsidered the syntax of `WITH DRAIN`, and found `WITH DRAIN` should be an attribute to `WITH SAVEPOINT`. That's to say, we could not have `WITH DRAIN` without `WITH SAVEPOINT`. How about we keep the order and validate that `WITH DRAIN` could only appear after `WITH SAVEPOINT`? -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org