dianfu 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_r284989854
 
 

 ##########
 File path: 
flink-clients/src/main/java/org/apache/flink/client/cli/ProgramOptions.java
 ##########
 @@ -62,21 +65,68 @@
 
        private final SavepointRestoreSettings savepointSettings;
 
+       // Store whether the job is python.
+       private boolean isPython = false;
+
        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();
+
+               // If specified the option -py(--python)
+               if (line.hasOption(PY_OPTION.getLongOpt())) {
+                       isPython = true;
+                       // You can't use option -py and -pym simultaneously.
+                       if (line.hasOption(PYMODULE_OPTION.getLongOpt())) {
+                               throw new CliArgsException("You can't use 
option -py and -pym simultaneously.");
+                       }
+                       // the args format is : python ${python.py} 
[optional]py-files [optional]${py-files} [optional]other args.
+                       // e.g. python wordcount.py
+                       // e.g. python wordcount.py py-files 
file:///AAA.py,hdfs:///BBB.py --input in.txt --output out.txt
+                       String[] newArgs;
+                       int copyIndex;
 
 Review comment:
   copyIndex -> argIndex

----------------------------------------------------------------
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

Reply via email to