homebrew-core/Formula/apache-spark.rb

35 lines
1.0 KiB
Ruby

class ApacheSpark < Formula
desc "Engine for large-scale data processing"
homepage "https://spark.apache.org/"
url "https://www.apache.org/dyn/closer.lua?path=spark/spark-3.0.1/spark-3.0.1-bin-hadoop3.2.tgz"
mirror "https://archive.apache.org/dist/spark/spark-3.0.1/spark-3.0.1-bin-hadoop3.2.tgz"
version "3.0.1"
sha256 "e2d05efa1c657dd5180628a83ea36c97c00f972b4aee935b7affa2e1058b0279"
license "Apache-2.0"
head "https://github.com/apache/spark.git"
livecheck do
url :stable
end
bottle :unneeded
depends_on "openjdk@11"
def install
# Rename beeline to distinguish it from hive's beeline
mv "bin/beeline", "bin/spark-beeline"
rm_f Dir["bin/*.cmd"]
libexec.install Dir["*"]
bin.install Dir[libexec/"bin/*"]
bin.env_script_all_files(libexec/"bin", JAVA_HOME: Formula["openjdk@11"].opt_prefix)
end
test do
assert_match "Long = 1000",
pipe_output(bin/"spark-shell --conf spark.driver.bindAddress=127.0.0.1",
"sc.parallelize(1 to 1000).count()")
end
end