Skip to content

Commit

Permalink
[Feature-3160] Delete separator configuration item (#3161)
Browse files Browse the repository at this point in the history
Co-authored-by: Zzm0809 <Zzm0809@users.noreply.github.com>
  • Loading branch information
Zzm0809 and Zzm0809 authored Feb 18, 2024
1 parent 5c8f28c commit 5cfe742
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 17 deletions.
8 changes: 1 addition & 7 deletions dinky-admin/src/test/java/org/dinky/utils/SqlUtilTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@

package org.dinky.utils;

import static org.dinky.data.enums.Status.SYS_FLINK_SETTINGS_SQLSEPARATOR;

import org.dinky.data.model.SystemConfiguration;

import org.assertj.core.api.Assertions;
import org.junit.Ignore;
import org.junit.Test;
Expand Down Expand Up @@ -62,9 +58,7 @@ public void getStatements() {
String sql = "set 'state.savepoints.dir' = 'hdfs://namenode:9000/tmp/checkpoint'; --ddd\n"
+ "set 'state.checkpoints.dir' = 'hdfs://namenode:9000/tmp/checkpoint'; --dd \n"
+ "create table abc ;\n";
SystemConfiguration.getInstances()
.setConfiguration(SYS_FLINK_SETTINGS_SQLSEPARATOR.getKey(), ";\\s*(?:\\n|--.*)");
String[] statements = SqlUtil.getStatements(sql);
String[] statements = SqlUtil.getStatements(sql, ";\\s*(?:\\n|--.*)");
Assertions.assertThat(statements.length).isEqualTo(3);
}
}
2 changes: 0 additions & 2 deletions dinky-common/src/main/java/org/dinky/data/enums/Status.java
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,6 @@ public enum Status {
*/
SYS_FLINK_SETTINGS_USERESTAPI(100, "sys.flink.settings.useRestAPI"),
SYS_FLINK_SETTINGS_USERESTAPI_NOTE(101, "sys.flink.settings.useRestAPI.note"),
SYS_FLINK_SETTINGS_SQLSEPARATOR(102, "sys.flink.settings.sqlSeparator"),
SYS_FLINK_SETTINGS_SQLSEPARATOR_NOTE(103, "sys.flink.settings.sqlSeparator.note"),
SYS_FLINK_SETTINGS_JOBIDWAIT(104, "sys.flink.settings.jobIdWait"),
SYS_FLINK_SETTINGS_JOBIDWAIT_NOTE(105, "sys.flink.settings.jobIdWait.note"),
SYS_MAVEN_SETTINGS_SETTINGSFILEPATH(106, "sys.maven.settings.settingsFilePath"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@ public static Configuration.OptionBuilder key(Status status) {
.booleanType()
.defaultValue(true)
.note(Status.SYS_FLINK_SETTINGS_USERESTAPI_NOTE);
private final Configuration<String> sqlSeparator = key(Status.SYS_FLINK_SETTINGS_SQLSEPARATOR)
.stringType()
.defaultValue(";\\n")
.note(Status.SYS_FLINK_SETTINGS_SQLSEPARATOR_NOTE);

private final Configuration<Integer> jobIdWait = key(Status.SYS_FLINK_SETTINGS_JOBIDWAIT)
.intType()
.defaultValue(30)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,6 @@ daemon.task.not.support=threaded task types are notsupported
# system config
sys.flink.settings.useRestAPI=Use Rest API
sys.flink.settings.useRestAPI.note=Whether to use RestAPI when operating and maintaining Flink tasks
sys.flink.settings.sqlSeparator=SQL Separator
sys.flink.settings.sqlSeparator.note=please note: The default delimiter is ';', if your SQL contains ';', please modify this configuration to other characters, for example: ';\\n', please ignore the single quotes!!!!
sys.flink.settings.jobIdWait=Job submission waiting time
sys.flink.settings.jobIdWait.note=Maximum waiting time (seconds) for obtaining Job ID when submitting Application or PerJob tasks
sys.maven.settings.settingsFilePath=Maven configuration file path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,6 @@ alert.rule.checkpointTimeout=checkpoint超时
# system config
sys.flink.settings.useRestAPI=使用 Rest API
sys.flink.settings.useRestAPI.note=在运维 Flink 任务时是否使用 RestAPI
sys.flink.settings.sqlSeparator=SQL 分隔符
sys.flink.settings.sqlSeparator.note=请注意: 默认分隔符为 ';' ,如果您的 SQL 中包含 ';' ,请修改此项配置为其他字符,例如: ';\\n', 请忽略单引号!!!!
sys.flink.settings.jobIdWait=Job 提交等待时间
sys.flink.settings.jobIdWait.note=提交 Application 或 PerJob 任务时获取 Job ID 的最大等待时间(秒)
sys.maven.settings.settingsFilePath=Maven 配置文件路径
Expand Down

0 comments on commit 5cfe742

Please sign in to comment.