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:43:43 UTC

[flink] branch release-1.12 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.12
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/release-1.12 by this push:
     new f1886ef  [FLINK-24336][python] Fix the issue that jar url list may contain empty string.
f1886ef is described below

commit f1886efe75f400abf8136b4371cd43a12684b7f6
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 fd7b9e5..3130292 100644
--- a/flink-python/pyflink/table/table_environment.py
+++ b/flink-python/pyflink/table/table_environment.py
@@ -1518,13 +1518,15 @@ class TableEnvironment(object, metaclass=ABCMeta):
         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)
             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))
 
     @abstractmethod
     def _get_j_env(self):