You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by xu...@apache.org on 2016/11/13 03:15:05 UTC

hive git commit: HIVE-15096: hplsql registerUDF conflicts with pom.xml (Fei Hui, reviewed by Dmitry Tolpeko and Ferdinand Xu)

Repository: hive
Updated Branches:
  refs/heads/master e00f909dd -> 532e6a72e


HIVE-15096: hplsql registerUDF conflicts with pom.xml (Fei Hui, reviewed by Dmitry Tolpeko and Ferdinand Xu)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/532e6a72
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/532e6a72
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/532e6a72

Branch: refs/heads/master
Commit: 532e6a72eab4efd1d3bcb49ae5e520d21b1c0712
Parents: e00f909
Author: Ferdinand Xu <ch...@intel.com>
Authored: Sun Nov 13 03:43:16 2016 +0800
Committer: Ferdinand Xu <ch...@intel.com>
Committed: Sun Nov 13 03:43:16 2016 +0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/hive/hplsql/Exec.java | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/532e6a72/hplsql/src/main/java/org/apache/hive/hplsql/Exec.java
----------------------------------------------------------------------
diff --git a/hplsql/src/main/java/org/apache/hive/hplsql/Exec.java b/hplsql/src/main/java/org/apache/hive/hplsql/Exec.java
index 6da4f5b..18b5eaf 100644
--- a/hplsql/src/main/java/org/apache/hive/hplsql/Exec.java
+++ b/hplsql/src/main/java/org/apache/hive/hplsql/Exec.java
@@ -615,9 +615,20 @@ public class Exec extends HplsqlBaseVisitor<Integer> {
     }
     ArrayList<String> sql = new ArrayList<String>();
     String dir = Utils.getExecDir();
-    sql.add("ADD JAR " + dir + "hplsql.jar");
-    sql.add("ADD JAR " + dir + "antlr-runtime-4.5.jar");
-    sql.add("ADD FILE " + dir + Conf.SITE_XML);
+    String hplsqlJarName = "hplsql.jar";
+    for(String jarName: new java.io.File(dir).list()) {
+      if(jarName.startsWith("hive-hplsql") && jarName.endsWith(".jar")) {
+        hplsqlJarName = jarName;
+        break;
+      }
+    }
+    sql.add("ADD JAR " + dir + hplsqlJarName);
+    sql.add("ADD JAR " + dir + "antlr4-runtime-4.5.jar");
+    if(!conf.getLocation().equals("")) {
+      sql.add("ADD FILE " + conf.getLocation());
+    } else {
+      sql.add("ADD FILE " + dir + Conf.SITE_XML);
+    }
     if (dotHplsqlrcExists) {
       sql.add("ADD FILE " + dir + Conf.DOT_HPLSQLRC);
     }