Skip to content

Commit d6fb44a

Browse files
committed
fix can't find mysqlasyncside plugin bug
1 parent 427f200 commit d6fb44a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

core/src/main/java/com/dtstack/flink/sql/Main.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
package com.dtstack.flink.sql;
2222

2323
import com.dtstack.flink.sql.classloader.DtClassLoader;
24+
import com.dtstack.flink.sql.enums.ECacheType;
2425
import com.dtstack.flink.sql.parser.CreateFuncParser;
2526
import com.dtstack.flink.sql.parser.InsertSqlParser;
2627
import com.dtstack.flink.sql.side.SideSqlExec;
@@ -272,8 +273,9 @@ private static void registerTable(SqlTree sqlTree, StreamExecutionEnvironment en
272273
classPathSet.add( PluginUtil.getRemoteJarFilePath(tableInfo.getType(), TargetTableInfo.TARGET_SUFFIX, remoteSqlPluginPath));
273274
} else if(tableInfo instanceof SideTableInfo){
274275

276+
String sideOperator = ECacheType.ALL.name().equals(((SideTableInfo) tableInfo).getCacheType()) ? "all" : "async";
275277
sideTableMap.put(tableInfo.getName(), (SideTableInfo) tableInfo);
276-
classPathSet.add(PluginUtil.getRemoteJarFilePath(tableInfo.getType(), SideTableInfo.TARGET_SUFFIX, remoteSqlPluginPath));
278+
classPathSet.add(PluginUtil.getRemoteSideJarFilePath(tableInfo.getType(), sideOperator, SideTableInfo.TARGET_SUFFIX, remoteSqlPluginPath));
277279
}else {
278280
throw new RuntimeException("not support table type:" + tableInfo.getType());
279281
}

core/src/main/java/com/dtstack/flink/sql/util/PluginUtil.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,18 @@ public static Properties stringToProperties(String str) throws IOException{
9494
return properties;
9595
}
9696

97-
public static URL getRemoteJarFilePath(String pluginType, String tableType,String remoteSqlRootDir) throws MalformedURLException {
97+
public static URL getRemoteJarFilePath(String pluginType, String tableType, String remoteSqlRootDir) throws MalformedURLException {
9898
String dirName = pluginType + tableType.toLowerCase();
9999
String jarName = String.format("%s-%s.jar", pluginType, tableType.toLowerCase());
100100
return new URL("file:" + remoteSqlRootDir + SP + dirName + SP + jarName);
101101
}
102102

103+
public static URL getRemoteSideJarFilePath(String pluginType, String sideOperator, String tableType, String remoteSqlRootDir) throws MalformedURLException {
104+
String dirName = pluginType + sideOperator + tableType.toLowerCase();
105+
String jarName = String.format("%s-%s-%s.jar", pluginType, sideOperator, tableType.toLowerCase());
106+
return new URL("file:" + remoteSqlRootDir + SP + dirName + SP + jarName);
107+
}
108+
103109
public static String upperCaseFirstChar(String str){
104110
return str.substring(0, 1).toUpperCase() + str.substring(1);
105111
}

0 commit comments

Comments
 (0)