Unverified Commit 9dcf9ec6 authored by aiwenmo's avatar aiwenmo Committed by GitHub

[Fix-2535] [studio] Fix the variable of sql dockermysql does not exist when checking task (#2536)

parent 8bf8adc4
...@@ -158,7 +158,13 @@ public class TaskController { ...@@ -158,7 +158,13 @@ public class TaskController {
@ApiOperation("Get Job Plan") @ApiOperation("Get Job Plan")
@ExecuteProcess(type = ProcessType.FLINK_JOB_PLAN) @ExecuteProcess(type = ProcessType.FLINK_JOB_PLAN)
public Result<ObjectNode> getJobPlan(@ProcessId @RequestBody TaskDTO taskDTO) { public Result<ObjectNode> getJobPlan(@ProcessId @RequestBody TaskDTO taskDTO) {
return Result.succeed(taskService.getJobPlan(taskDTO), Status.EXECUTE_SUCCESS); ObjectNode jobPlan = null;
try {
jobPlan = taskService.getJobPlan(taskDTO);
} catch (Exception e) {
return Result.failed(e.getMessage());
}
return Result.succeed(jobPlan, Status.EXECUTE_SUCCESS);
} }
@PutMapping @PutMapping
......
...@@ -128,7 +128,7 @@ public class APIExecuteSqlDTO extends AbstractStatementDTO { ...@@ -128,7 +128,7 @@ public class APIExecuteSqlDTO extends AbstractStatementDTO {
.useRemote(true) .useRemote(true)
.address(address) .address(address)
.jobName(jobName) .jobName(jobName)
.fragment(isFragment()) .fragment(getFragment())
.statementSet(useStatementSet) .statementSet(useStatementSet)
.maxRowNum(maxRowNum) .maxRowNum(maxRowNum)
.checkpoint(checkPoint) .checkpoint(checkPoint)
......
...@@ -59,7 +59,7 @@ public class APIExplainSqlDTO extends AbstractStatementDTO { ...@@ -59,7 +59,7 @@ public class APIExplainSqlDTO extends AbstractStatementDTO {
return JobConfig.builder() return JobConfig.builder()
.type(GatewayType.LOCAL.getLongValue()) .type(GatewayType.LOCAL.getLongValue())
.useRemote(false) .useRemote(false)
.fragment(isFragment()) .fragment(getFragment())
.statementSet(useStatementSet) .statementSet(useStatementSet)
.parallelism(parallelism) .parallelism(parallelism)
.configJson(configuration) .configJson(configuration)
......
...@@ -41,7 +41,7 @@ public class AbstractStatementDTO { ...@@ -41,7 +41,7 @@ public class AbstractStatementDTO {
private Integer envId; private Integer envId;
@ApiModelProperty(value = "Fragment Flag", dataType = "boolean", example = "false", notes = "是否为片段") @ApiModelProperty(value = "Fragment Flag", dataType = "boolean", example = "false", notes = "是否为片段")
private boolean fragment = false; private Boolean fragment;
@ApiModelProperty( @ApiModelProperty(
value = "Variables", value = "Variables",
......
...@@ -70,7 +70,7 @@ public class StudioMetaStoreDTO extends AbstractStatementDTO { ...@@ -70,7 +70,7 @@ public class StudioMetaStoreDTO extends AbstractStatementDTO {
.useResult(true) .useResult(true)
.useChangeLog(false) .useChangeLog(false)
.useAutoCancel(false) .useAutoCancel(false)
.fragment(isFragment()) .fragment(getFragment())
.statementSet(false) .statementSet(false)
.batchModel(false) .batchModel(false)
.maxRowNum(0) .maxRowNum(0)
......
...@@ -227,7 +227,7 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen ...@@ -227,7 +227,7 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
public String buildEnvSql(AbstractStatementDTO task) { public String buildEnvSql(AbstractStatementDTO task) {
log.info("Start initialize FlinkSQLEnv:"); log.info("Start initialize FlinkSQLEnv:");
String sql = CommonConstant.LineSep; String sql = CommonConstant.LineSep;
if (task.isFragment()) { if (task.getFragment()) {
String flinkWithSql = dataBaseService.getEnabledFlinkWithSql(); String flinkWithSql = dataBaseService.getEnabledFlinkWithSql();
if (Asserts.isNotNullString(flinkWithSql)) { if (Asserts.isNotNullString(flinkWithSql)) {
sql += flinkWithSql + CommonConstant.LineSep; sql += flinkWithSql + CommonConstant.LineSep;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment