Skip to content

Commit

Permalink
fix_session_cannot_use_add_customjar
Browse files Browse the repository at this point in the history
  • Loading branch information
zackyoungh committed Nov 27, 2024
1 parent f969c84 commit 47f3988
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions dinky-core/src/main/java/org/dinky/job/runner/JobDDLRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,26 +144,24 @@ public SqlExplainResult explain(JobStatement jobStatement) {

private void executeAdd(String statement) {
Set<File> allFilePath = AddJarSqlParseStrategy.getAllFilePath(statement);
allFilePath
.forEach(t -> jobManager.getUdfPathContextHolder().addOtherPlugins(t));
allFilePath.forEach(t -> jobManager.getUdfPathContextHolder().addOtherPlugins(t));
(jobManager.getExecutor().getDinkyClassLoader())
.addURLs(URLUtils.getURLs(jobManager.getUdfPathContextHolder().getOtherPluginsFiles()));
}

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

private void executeAddJar(String statement) {
Set<File> allFilePath = AddFileSqlParseStrategy.getAllFilePath(statement);
Configuration combinationConfig = getCombinationConfig();
FileSystem.initialize(combinationConfig, null);
jobManager.getExecutor().addJar(ArrayUtil.toArray(allFilePath,File.class));
jobManager.getExecutor().addJar(ArrayUtil.toArray(allFilePath, File.class));
jobManager.getExecutor().executeSql(statement);
}

Expand Down

0 comments on commit 47f3988

Please sign in to comment.