Skip to content

Commit 5fb09f7

Browse files
committed
[hotfix-34950][core]prevent current sql use last sql's sideTableInfo
1 parent ab471a3 commit 5fb09f7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

core/src/main/java/com/dtstack/flink/sql/exec/ExecuteProcessHelper.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
import org.apache.calcite.sql.SqlInsert;
5454
import org.apache.calcite.sql.SqlNode;
5555
import org.apache.commons.io.Charsets;
56+
import org.apache.commons.lang3.SerializationUtils;
5657
import org.apache.commons.lang3.StringUtils;
5758
import org.apache.flink.api.common.typeinfo.TypeInformation;
5859
import org.apache.flink.api.java.typeutils.RowTypeInfo;
@@ -75,13 +76,7 @@
7576
import java.net.URLClassLoader;
7677
import java.net.URLDecoder;
7778
import java.time.ZoneId;
78-
import java.util.ArrayList;
79-
import java.util.Arrays;
80-
import java.util.List;
81-
import java.util.Map;
82-
import java.util.Properties;
83-
import java.util.Set;
84-
import java.util.TimeZone;
79+
import java.util.*;
8580
import java.util.stream.Stream;
8681

8782
/**
@@ -215,7 +210,11 @@ private static void sqlTranslation(String localSqlPluginPath,
215210
scope++;
216211
}
217212

213+
final Map<String, AbstractSideTableInfo> tmpTableMap = new HashMap<>();
218214
for (InsertSqlParser.SqlParseResult result : sqlTree.getExecSqlList()) {
215+
// prevent current sql use last sql's sideTableInfo
216+
sideTableMap.forEach((s, abstractSideTableInfo) -> tmpTableMap.put(s, SerializationUtils.clone(abstractSideTableInfo)));
217+
219218
if (LOG.isInfoEnabled()) {
220219
LOG.info("exe-sql:\n" + result.getExecSql());
221220
}
@@ -251,6 +250,7 @@ private static void sqlTranslation(String localSqlPluginPath,
251250

252251
scope++;
253252
}
253+
tmpTableMap.clear();
254254
}
255255
}
256256

0 commit comments

Comments
 (0)