[
https://issues.apache.org/jira/browse/PHOENIX-4231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16375065#comment-16375065
]
ASF GitHub Bot commented on PHOENIX-4231:
-----------------------------------------
Github user aertoria commented on a diff in the pull request:
https://github.com/apache/phoenix/pull/292#discussion_r170387933
--- Diff:
phoenix-core/src/main/java/org/apache/phoenix/expression/function/UDFExpression.java
---
@@ -198,18 +199,26 @@ public static DynamicClassLoader getClassLoader(final
PName tenantId, final Stri
}
return cl;
} else {
- cl = pathSpecificCls.get(jarPath);
- if (cl == null) {
- Configuration conf = HBaseConfiguration.create(config);
- conf.set(DYNAMIC_JARS_DIR_KEY, parent);
- cl = new DynamicClassLoader(conf,
UDFExpression.class.getClassLoader());
- }
- // Cache class loader as a weak value, will be GC'ed when no
reference left
- DynamicClassLoader prev = pathSpecificCls.putIfAbsent(jarPath,
cl);
- if (prev != null) {
- cl = prev;
+ String rawPath = new
Path(config.get(DYNAMIC_JARS_DIR_KEY)).toUri().getRawPath();
+ // jarPath is provided as an HDFS URI without scheme and
authority, but the jar is inside the configured hbase.dynamic.jars.dir
+ if(rawPath.equals(parent)) {
--- End diff --
This if block seems will never be reachable. See line 188. Aren't these
two condition equivalent?
> Support restriction of remote UDF load sources
> -----------------------------------------------
>
> Key: PHOENIX-4231
> URL: https://issues.apache.org/jira/browse/PHOENIX-4231
> Project: Phoenix
> Issue Type: Improvement
> Reporter: Andrew Purtell
> Assignee: Chinmay Kulkarni
> Priority: Major
>
> When allowUserDefinedFunctions is true, users can load UDFs remotely via a
> jar file from any HDFS filesystem reachable on the network. The setting
> hbase.dynamic.jars.dir can be used to restrict locations for jar loading but
> is only applied to jars loaded from the local filesystem. We should
> implement support for similar restriction via configuration for jars loaded
> via hdfs:// URIs.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)