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_r286800550
 
 

 ##########
 File path: 
flink-clients/src/main/java/org/apache/flink/client/program/PackagedProgram.java
 ##########
 @@ -169,18 +173,23 @@ public PackagedProgram(File jarFile, @Nullable String 
entryPointClassName, Strin
         *         may be a missing / wrong class or manifest files.
         */
        public PackagedProgram(File jarFile, List<URL> classpaths, @Nullable 
String entryPointClassName, String... args) throws ProgramInvocationException {
-               if (jarFile == null) {
+               // Whether the job is a Python job and PythonDriver is the 
entry point.
+               isPython = entryPointClassName != null && 
entryPointClassName.equals(PythonDriver.class.getCanonicalName());
+
+               if (jarFile == null && !isPython) {
                        throw new IllegalArgumentException("The jar file must 
not be null.");
                }
 
-               URL jarFileUrl;
-               try {
-                       jarFileUrl = jarFile.getAbsoluteFile().toURI().toURL();
-               } catch (MalformedURLException e1) {
-                       throw new IllegalArgumentException("The jar file path 
is invalid.");
-               }
+               URL jarFileUrl = null;
+               if (jarFile != null) {
 
 Review comment:
   Yes.I have optimized these code.Thank you.

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