From dev-return-49159-archive-asf-public=cust-asf.ponee.io@phoenix.apache.org Wed Feb 7 00:47:34 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id E6E19180657 for ; Wed, 7 Feb 2018 00:47:34 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id D7276160C46; Tue, 6 Feb 2018 23:47:34 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 29B83160C45 for ; Wed, 7 Feb 2018 00:47:34 +0100 (CET) Received: (qmail 37979 invoked by uid 500); 6 Feb 2018 23:47:33 -0000 Mailing-List: contact dev-help@phoenix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.apache.org Delivered-To: mailing list dev@phoenix.apache.org Received: (qmail 37963 invoked by uid 99); 6 Feb 2018 23:47:32 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Feb 2018 23:47:32 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7311EDFC29; Tue, 6 Feb 2018 23:47:31 +0000 (UTC) From: apurtell To: dev@phoenix.apache.org Reply-To: dev@phoenix.apache.org References: In-Reply-To: Subject: [GitHub] phoenix pull request #292: PHOENIX-4231: Support restriction of remote UDF l... Content-Type: text/plain Message-Id: <20180206234731.7311EDFC29@git1-us-west.apache.org> Date: Tue, 6 Feb 2018 23:47:31 +0000 (UTC) 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 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? ---