From dev-return-49701-archive-asf-public=cust-asf.ponee.io@phoenix.apache.org Mon Feb 26 23:19:11 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 98BB518064A for ; Mon, 26 Feb 2018 23:19:10 +0100 (CET) Received: (qmail 91992 invoked by uid 500); 26 Feb 2018 22:19:09 -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 91977 invoked by uid 99); 26 Feb 2018 22:19:08 -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; Mon, 26 Feb 2018 22:19:08 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 37E90F3333; Mon, 26 Feb 2018 22:19:08 +0000 (UTC) From: aertoria 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: <20180226221908.37E90F3333@git1-us-west.apache.org> Date: Mon, 26 Feb 2018 22:19:08 +0000 (UTC) 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 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. ---