Skip to content

Commit cc10a28

Browse files
authored
[BugFix][Flink]Fix the Flink task to submit the session mode. (#3967)
1 parent e9061cb commit cc10a28

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

dinky-core/src/main/java/org/dinky/executor/Executor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ public void initPyUDF(String executable, String... udfPyFilePath) {
275275
private void addJar(String... jarPath) {
276276
Configuration configuration = tableEnvironment.getRootConfiguration();
277277
List<String> jars = configuration.get(PipelineOptions.JARS);
278-
if (jars == null) {
278+
if (CollUtil.isEmpty(jars)) {
279279
tableEnvironment.addConfiguration(PipelineOptions.JARS, CollUtil.newArrayList(jarPath));
280280
} else {
281281
CollUtil.addAll(jars, jarPath);

dinky-core/src/main/java/org/dinky/job/runner/JobDDLRunner.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,22 +143,25 @@ public SqlExplainResult explain(JobStatement jobStatement) {
143143
}
144144

145145
private void executeAdd(String statement) {
146-
AddJarSqlParseStrategy.getAllFilePath(statement)
147-
.forEach(t -> jobManager.getUdfPathContextHolder().addOtherPlugins(t));
146+
Set<File> allFilePath = AddJarSqlParseStrategy.getAllFilePath(statement);
147+
allFilePath.forEach(t -> jobManager.getUdfPathContextHolder().addOtherPlugins(t));
148148
(jobManager.getExecutor().getDinkyClassLoader())
149149
.addURLs(URLUtils.getURLs(jobManager.getUdfPathContextHolder().getOtherPluginsFiles()));
150150
}
151151

152152
private void executeAddFile(String statement) {
153-
AddFileSqlParseStrategy.getAllFilePath(statement)
154-
.forEach(t -> jobManager.getUdfPathContextHolder().addFile(t));
153+
Set<File> allFilePath = AddFileSqlParseStrategy.getAllFilePath(statement);
154+
allFilePath.forEach(t -> jobManager.getUdfPathContextHolder().addFile(t));
155155
(jobManager.getExecutor().getDinkyClassLoader())
156156
.addURLs(URLUtils.getURLs(jobManager.getUdfPathContextHolder().getFiles()));
157+
jobManager.getExecutor().addJar(ArrayUtil.toArray(allFilePath, File.class));
157158
}
158159

159160
private void executeAddJar(String statement) {
161+
Set<File> allFilePath = AddFileSqlParseStrategy.getAllFilePath(statement);
160162
Configuration combinationConfig = getCombinationConfig();
161163
FileSystem.initialize(combinationConfig, null);
164+
jobManager.getExecutor().addJar(ArrayUtil.toArray(allFilePath, File.class));
162165
jobManager.getExecutor().executeSql(statement);
163166
}
164167

0 commit comments

Comments
 (0)