Skip to content

Commit

Permalink
fix bool maybe NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
Zzm0809 committed Feb 26, 2024
1 parent 81e1f19 commit ed5f7cb
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public JobConfig getJobConfig() {
.useRemote(true)
.address(address)
.jobName(jobName)
.fragment(getFragment())
.fragment(isFragment())
.statementSet(useStatementSet)
.maxRowNum(maxRowNum)
.checkpoint(checkPoint)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public JobConfig getJobConfig() {
return JobConfig.builder()
.type(GatewayType.LOCAL.getLongValue())
.useRemote(false)
.fragment(getFragment())
.fragment(isFragment())
.statementSet(useStatementSet)
.parallelism(parallelism)
.configJson(configuration)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class AbstractStatementDTO {
private Integer envId;

@ApiModelProperty(value = "Fragment Flag", dataType = "boolean", example = "false", notes = "是否为片段")
private Boolean fragment = false;
private boolean fragment = false;

@ApiModelProperty(
value = "Variables",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public JobConfig getJobConfig() {
.useResult(true)
.useChangeLog(false)
.useAutoCancel(false)
.fragment(getFragment())
.fragment(isFragment())
.statementSet(false)
.batchModel(false)
.maxRowNum(0)
Expand Down
11 changes: 1 addition & 10 deletions dinky-admin/src/main/java/org/dinky/data/dto/TaskDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,6 @@ public class TaskDTO extends AbstractStatementDTO {
@ApiModelProperty(value = "Parallelism", dataType = "Integer", example = "4", notes = "The parallelism level")
private Integer parallelism;

@ApiModelProperty(
value = "Fragment",
dataType = "Boolean",
example = "true",
notes = "Fragment option for the task")
private Boolean fragment;

@ApiModelProperty(
value = "Use Statement Set",
dataType = "boolean",
Expand All @@ -98,7 +91,7 @@ public class TaskDTO extends AbstractStatementDTO {
dataType = "boolean",
example = "true",
notes = "Flag indicating whether to use batch processing")
private boolean batchModel;
private boolean batchModel = false;

@ApiModelProperty(
value = "ClusterInstance ID",
Expand Down Expand Up @@ -161,8 +154,6 @@ public class TaskDTO extends AbstractStatementDTO {
@ApiModelProperty(value = "Enabled", required = true, dataType = "Boolean", example = "true")
private Boolean enabled;

@ApiModelProperty(value = "Statement", dataType = "String", notes = "SQL statement for the task")
private String statement;

@ApiModelProperty(value = "ClusterInstance Name", dataType = "String", notes = "Name of the associated cluster")
private String clusterName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ public JobConfig buildJobConfig(TaskDTO task) {
public String buildEnvSql(AbstractStatementDTO task) {
log.info("Start initialize FlinkSQLEnv:");
String sql = CommonConstant.LineSep;
if (task.getFragment()) {
if (task.isFragment()) {
String flinkWithSql = dataBaseService.getEnabledFlinkWithSql();
if (Asserts.isNotNullString(flinkWithSql)) {
sql += flinkWithSql + CommonConstant.LineSep;
Expand Down

0 comments on commit ed5f7cb

Please sign in to comment.