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 them to:
```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-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 them to:
```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
}
}
```
--
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]