dianfu commented on a change in pull request #13292:
URL: https://github.com/apache/flink/pull/13292#discussion_r483563989
##########
File path: flink-python/pyflink/datastream/stream_execution_environment.py
##########
@@ -553,6 +553,33 @@ def set_python_executable(self, python_exec: str):
.getEnvironmentConfig(self._j_stream_execution_environment)
env_config.setString(jvm.PythonOptions.PYTHON_EXECUTABLE.key(),
python_exec)
+ def add_jars(self, jars_path: str):
+ """
+ Adds a list of jar files that will be uploaded to the cluster and
referenced by the job.
+
+ :param jars_path: Path of jars that delimited by ';'.
+ """
+ jvm = get_gateway().jvm
+ jars_key =
jvm.org.apache.flink.configuration.PipelineOptions.JARS.key()
+ add_jars_to_context_class_loader(jars_path.split(";"))
+ env_config = jvm.org.apache.flink.python.util.PythonConfigUtil \
+ .getEnvironmentConfig(self._j_stream_execution_environment)
+ env_config.setString(jars_key, jars_path)
+
+ def add_classpaths(self, classpaths: str):
Review comment:
ditto
##########
File path: flink-python/pyflink/datastream/stream_execution_environment.py
##########
@@ -553,6 +553,33 @@ def set_python_executable(self, python_exec: str):
.getEnvironmentConfig(self._j_stream_execution_environment)
env_config.setString(jvm.PythonOptions.PYTHON_EXECUTABLE.key(),
python_exec)
+ def add_jars(self, jars_path: str):
Review comment:
Do you think it makes sense to change the interface a bit as following?
```suggestion
def add_jars(self, *jars: str):
```
Besides, we should also consider cases where users may call add_jars
multiple times.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]