From a81d93bb39636ceb9a3b3f4fe4b84c4cf96e0331 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Mon, 25 Jan 2021 08:14:41 -0800 Subject: [PATCH] hive: fix Java version (#69686) --- Formula/hive.rb | 12 ++++++------ .../versioned_dependencies_conflicts_allowlist.json | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Formula/hive.rb b/Formula/hive.rb index 91adbcbe1ad..daee154f054 100644 --- a/Formula/hive.rb +++ b/Formula/hive.rb @@ -5,7 +5,7 @@ class Hive < Formula mirror "https://archive.apache.org/dist/hive/hive-3.1.2/apache-hive-3.1.2-bin.tar.gz" sha256 "d75dcf36908b4e7b9b0ec9aec57a46a6628b97b276c233cb2c2f1a3e89b13462" license "Apache-2.0" - revision 2 + revision 3 livecheck do url :stable @@ -14,7 +14,7 @@ class Hive < Formula bottle :unneeded depends_on "hadoop" - depends_on "openjdk" + depends_on "openjdk@8" def install rm_f Dir["bin/*.cmd", "bin/ext/*.cmd", "bin/ext/util/*.cmd"] @@ -30,14 +30,14 @@ class Hive < Formula next if file.directory? (bin/file.basename).write_env_script file, - Language::Java.java_home_env.merge(HIVE_HOME: libexec) + JAVA_HOME: Formula["openjdk@8"].opt_prefix, + HADOOP_HOME: "${HADOOP_HOME:-#{Formula["hadoop"].opt_libexec}}", + HIVE_HOME: libexec end end def caveats <<~EOS - Hadoop must be in your path for hive executable to work. - If you want to use HCatalog with Pig, set $HCAT_HOME in your profile: export HCAT_HOME=#{opt_libexec}/hcatalog EOS @@ -45,6 +45,6 @@ class Hive < Formula test do system bin/"schematool", "-initSchema", "-dbType", "derby" - assert_match "Hive #{version}", shell_output("#{bin}/hive --version") + assert_match "123", shell_output("#{bin}/hive -e 'SELECT 123'") end end diff --git a/audit_exceptions/versioned_dependencies_conflicts_allowlist.json b/audit_exceptions/versioned_dependencies_conflicts_allowlist.json index fe153f66982..d5a6a952dd9 100644 --- a/audit_exceptions/versioned_dependencies_conflicts_allowlist.json +++ b/audit_exceptions/versioned_dependencies_conflicts_allowlist.json @@ -1,6 +1,7 @@ [ "anjuta", "fdroidserver", + "hive", "predictionio", "sqoop", "visp"