You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by di...@apache.org on 2021/09/24 01:41:02 UTC
[flink] branch release-1.14 updated: [FLINK-24336][python] Fix the
issue that jar url list may contain empty string.
This is an automated email from the ASF dual-hosted git repository.
dianfu pushed a commit to branch release-1.14
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/release-1.14 by this push:
new 85d4f68 [FLINK-24336][python] Fix the issue that jar url list may contain empty string.
85d4f68 is described below
commit 85d4f68e24ebac891c32f0fe672da65e534ea74d
Author: Xin Yu <sc...@gmail.com>
AuthorDate: Sat Sep 18 21:35:08 2021 +0800
[FLINK-24336][python] Fix the issue that jar url list may contain empty string.
This closes #17322.
---
flink-python/pyflink/table/table_environment.py | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/flink-python/pyflink/table/table_environment.py b/flink-python/pyflink/table/table_environment.py
index 9562fcc..b7fccff 100644
--- a/flink-python/pyflink/table/table_environment.py
+++ b/flink-python/pyflink/table/table_environment.py
@@ -1694,13 +1694,15 @@ class TableEnvironment(object):
jvm = get_gateway().jvm
jar_urls = self.get_config().get_configuration().get_string(config_key, None)
if jar_urls is not None:
- # normalize and remove duplicates
- jar_urls_set = set([jvm.java.net.URL(url).toString() for url in jar_urls.split(";")])
+ # normalize
+ jar_urls_list = [jvm.java.net.URL(url).toString() for url in jar_urls.split(";")]
j_configuration = get_j_env_configuration(self._get_j_env())
if j_configuration.containsKey(config_key):
for url in j_configuration.getString(config_key, "").split(";"):
- jar_urls_set.add(url)
- j_configuration.setString(config_key, ";".join(jar_urls_set))
+ url = url.strip()
+ if url != "" and url not in jar_urls_list:
+ jar_urls_list.append(url)
+ j_configuration.setString(config_key, ";".join(jar_urls_list))
def _get_j_env(self):
return self._j_tenv.getPlanner().getExecEnv()