phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PHOENIX-4231) Support restriction of remote UDF load sources
Date Mon, 26 Feb 2018 22:20:00 GMT

    [ https://issues.apache.org/jira/browse/PHOENIX-4231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16377696#comment-16377696
] 

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_r170755367
  
    --- Diff: phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixStatement.java ---
    @@ -907,10 +909,15 @@ public MutationState execute() throws SQLException {
                         try {
                             FileSystem fs = dynamicJarsDirPath.getFileSystem(conf);
                             List<LiteralParseNode> jarPaths = getJarPaths();
    -                        for (LiteralParseNode jarPath : jarPaths) {
    -                            File f = new File((String) jarPath.getValue());
    -                            fs.copyFromLocalFile(new Path(f.getAbsolutePath()), new Path(
    -                                    dynamicJarsDir + f.getName()));
    +                        for (LiteralParseNode jarPathNode : jarPaths) {
    +                          String jarPathName = (String) jarPathNode.getValue();
    +                          File f = new File(jarPathName);
    +                          Path dynamicJarsDirPathWithJar = new Path(dynamicJarsDir +
f.getName());
    +                          // Copy the jar (can be local or on HDFS) to the hbase.dynamic.jars.dir
directory.
    +                          // Note that this does not support HDFS URIs without scheme
and authority.
    +                          Path jarPath = new Path(jarPathName);
    +                          FileUtil.copy(jarPath.getFileSystem(conf), jarPath, fs, dynamicJarsDirPathWithJar,
    --- End diff --
    
    The comment "Note that this does not support HDFS URIs without scheme and authority."
I wonder where did you discover that.
    
    If I'm not mistaken FileUtil.copy internally calls fs.copyFromLocalFile without doing
file.islocal check.


> 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)

Mime
View raw message