Skip to content

Commit

Permalink
Use loader for chained plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jerqi committed Jan 26, 2025
1 parent 2de4d0b commit d156f23
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,13 @@ private void initPlugins(String catalogProvider, Map<String, String> properties)
try {
BaseAuthorization<?> authorization =
BaseAuthorization.createAuthorization(classLoader, authzProvider);

// Load the authorization plugin with the class loader of the catalog.
// Because the JDBC authorization plugin may load JDBC driver using the class
// loader.
AuthorizationPlugin authorizationPlugin =
authorization.newPlugin(metalake, catalogProvider, pluginConfig);
classLoader.withClassLoader(
cl -> authorization.newPlugin(metalake, catalogProvider, pluginConfig));
plugins.add(authorizationPlugin);
} catch (Exception e) {
throw new RuntimeException(e);
Expand Down

0 comments on commit d156f23

Please sign in to comment.