HuangXingBo commented on a change in pull request #8472: [FLINK-12327][python]
Adds support to submit Python Table API job in CliFrontend
URL: https://github.com/apache/flink/pull/8472#discussion_r286802489
##########
File path:
flink-clients/src/main/java/org/apache/flink/client/cli/ProgramOptions.java
##########
@@ -62,17 +65,63 @@
private final SavepointRestoreSettings savepointSettings;
+ // Flag indicating whether the job is a Python job.
+ private final boolean isPython;
+
protected ProgramOptions(CommandLine line) throws CliArgsException {
super(line);
String[] args = line.hasOption(ARGS_OPTION.getOpt()) ?
- line.getOptionValues(ARGS_OPTION.getOpt()) :
- line.getArgs();
+ line.getOptionValues(ARGS_OPTION.getOpt()) :
+ line.getArgs();
+
+ isPython = line.hasOption(PY_OPTION.getOpt()) |
line.hasOption(PYMODULE_OPTION.getOpt());
+ // If specified the option -py(--python)
+ if (line.hasOption(PY_OPTION.getOpt())) {
+ // Cannot use option -py and -pym simultaneously.
+ if (line.hasOption(PYMODULE_OPTION.getOpt())) {
+ throw new CliArgsException("Cannot use option
-py and -pym simultaneously.");
+ }
+ // The args format is : py ${python.py} [optional]pyfs
[optional]${py-files} [optional]other args.
Review comment:
I have added more decription about the transformation betweet CLI args and
PythonDriver args in the code note.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services