chengshiwen commented on a change in pull request #5453:
URL: https://github.com/apache/dolphinscheduler/pull/5453#discussion_r630982731



##########
File path: 
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/FlinkArgsUtils.java
##########
@@ -124,6 +124,10 @@ private FlinkArgsUtils() {
 
         ResourceInfo mainJar = param.getMainJar();
         if (mainJar != null) {
+            if (ProgramType.PYTHON == programType) {
+                // -py
+                args.add(Constants.FLINK_CLI_OPTION_PYTHON);
+            }

Review comment:
       These lines should not place here. It's better to modify:
   ```java
           if (programType != null) {
               if (programType == ProgramType.PYTHON) {
                   args.add(Constants.FLINK_PYTHON);        // -py
               } else if (programType != ProgramType.PYTHON && 
StringUtils.isNotEmpty(mainClass)) {
                   args.add(Constants.FLINK_MAIN_CLASS);    //-c
                   args.add(param.getMainClass());          //main class
               }
           }
   ```

##########
File path: 
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
##########
@@ -870,6 +870,7 @@ private Constants() {
     public static final String FLINK_MAIN_CLASS = "-c";
     public static final String FLINK_PARALLELISM = "-p";
     public static final String FLINK_SHUTDOWN_ON_ATTACHED_EXIT = "-sae";
+    public static final String FLINK_CLI_OPTION_PYTHON = "-py";

Review comment:
       I think maybe `FLINK_PYTHON` is better




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


Reply via email to