hive: fix Java version (#69686)

master
Andrew Kane 2021-01-25 08:14:41 -08:00 committed by GitHub
parent 257457454d
commit a81d93bb39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View File

@ -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" mirror "https://archive.apache.org/dist/hive/hive-3.1.2/apache-hive-3.1.2-bin.tar.gz"
sha256 "d75dcf36908b4e7b9b0ec9aec57a46a6628b97b276c233cb2c2f1a3e89b13462" sha256 "d75dcf36908b4e7b9b0ec9aec57a46a6628b97b276c233cb2c2f1a3e89b13462"
license "Apache-2.0" license "Apache-2.0"
revision 2 revision 3
livecheck do livecheck do
url :stable url :stable
@ -14,7 +14,7 @@ class Hive < Formula
bottle :unneeded bottle :unneeded
depends_on "hadoop" depends_on "hadoop"
depends_on "openjdk" depends_on "openjdk@8"
def install def install
rm_f Dir["bin/*.cmd", "bin/ext/*.cmd", "bin/ext/util/*.cmd"] rm_f Dir["bin/*.cmd", "bin/ext/*.cmd", "bin/ext/util/*.cmd"]
@ -30,14 +30,14 @@ class Hive < Formula
next if file.directory? next if file.directory?
(bin/file.basename).write_env_script file, (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
end end
def caveats def caveats
<<~EOS <<~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: If you want to use HCatalog with Pig, set $HCAT_HOME in your profile:
export HCAT_HOME=#{opt_libexec}/hcatalog export HCAT_HOME=#{opt_libexec}/hcatalog
EOS EOS
@ -45,6 +45,6 @@ class Hive < Formula
test do test do
system bin/"schematool", "-initSchema", "-dbType", "derby" 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
end end

View File

@ -1,6 +1,7 @@
[ [
"anjuta", "anjuta",
"fdroidserver", "fdroidserver",
"hive",
"predictionio", "predictionio",
"sqoop", "sqoop",
"visp" "visp"