wuchong commented on a change in pull request #10874: [FLINK-15552][table api]
parameters --library and --jar doesn't work for DDL in sqlClient
URL: https://github.com/apache/flink/pull/10874#discussion_r367738744
##########
File path:
flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/TableFactoryService.java
##########
@@ -214,7 +213,10 @@
.iterator()
.forEachRemaining(result::add);
} else {
-
defaultLoader.iterator().forEachRemaining(result::add);
+ ServiceLoader
+ .load(TableFactory.class,
Thread.currentThread().getContextClassLoader())
+ .iterator()
+ .forEachRemaining(result::add);
}
Review comment:
We can simplify it a bit more:
```java
ClassLoader cl =
classLoader.orElse(Thread.currentThread().getContextClassLoader());
ServiceLoader
.load(TableFactory.class, cl)
.iterator()
.forEachRemaining(result::add);
```
----------------------------------------------------------------
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]
With regards,
Apache Git Services