phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurtell <...@git.apache.org>
Subject [GitHub] phoenix pull request #292: PHOENIX-4231: Support restriction of remote UDF l...
Date Tue, 06 Feb 2018 23:47:31 GMT
Github user apurtell commented on a diff in the pull request:

    https://github.com/apache/phoenix/pull/292#discussion_r166479267
  
    --- 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 --
    
    If the client does not have perms to write to hbase.dynamic.jars.dir (and I expect normally
clients will not have write perms to this directory, only admin clients will have it), the
copy will fail and throw an IOException. The result may not be user friendly, though. Did
you try this? What happens? 


---

Mime
View raw message