HuangXingBo commented on code in PR #21725:
URL: https://github.com/apache/flink/pull/21725#discussion_r1080914005
##########
flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/service/context/DefaultContext.java:
##########
@@ -55,15 +58,31 @@ public DefaultContext(Configuration flinkConfig,
List<CustomCommandLine> command
flinkConfig,
PluginUtils.createPluginManagerFromRootFolder(flinkConfig));
Options commandLineOptions = collectCommandLineOptions(commandLines);
+
+ final List<URL> dependencies = new ArrayList<>();
+ // add python dependencies by default
+ try {
+ URL location =
+ Class.forName(
+
"org.apache.flink.python.PythonFunctionRunner",
+ false,
+
Thread.currentThread().getContextClassLoader())
+ .getProtectionDomain()
+ .getCodeSource()
+ .getLocation();
+ if (Paths.get(location.toURI()).toFile().isFile()) {
+ dependencies.add(location);
+ }
+ } catch (URISyntaxException | ClassNotFoundException e) {
+ throw new SqlExecutionException("Failed to find flink-python
jar.", e);
Review Comment:
Make sense.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]