Skip to content

Commit 4c72415

Browse files
authored
Merge pull request #247382 from Homebrew/apache-spark-openjdk@21
apache-spark: switch to `openjdk@21`
2 parents 7d70085 + 16f9e57 commit 4c72415

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

Formula/a/apache-spark.rb

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ class ApacheSpark < Formula
66
version "4.0.1"
77
sha256 "bd5315fa89db737f005971835b94e093c3d2b8581d2411737d281627d6803cc3"
88
license "Apache-2.0"
9+
revision 1
910
head "https://github.com/apache/spark.git", branch: "master"
1011

1112
# The download page creates file links using JavaScript, so we identify
@@ -16,10 +17,10 @@ class ApacheSpark < Formula
1617
end
1718

1819
bottle do
19-
sha256 cellar: :any_skip_relocation, all: "9a976508713bf1895b09cd55d0ac0f573f033a701e0f719302535cb5f36c96a1"
20+
sha256 cellar: :any_skip_relocation, all: "6567eb49d5d7f9e6e63d272d674e3d2e96a9eac837a8fee7d11f8c824f443177"
2021
end
2122

22-
depends_on "openjdk@17"
23+
depends_on "openjdk@21"
2324

2425
def install
2526
# Rename beeline to distinguish it from hive's beeline
@@ -28,16 +29,22 @@ def install
2829
rm(Dir["bin/*.cmd"])
2930
libexec.install Dir["*"]
3031
bin.install Dir[libexec/"bin/*"]
31-
bin.env_script_all_files(libexec/"bin", JAVA_HOME: Language::Java.overridable_java_home_env("17")[:JAVA_HOME])
32+
bin.env_script_all_files(libexec/"bin", JAVA_HOME: Language::Java.overridable_java_home_env("21")[:JAVA_HOME])
3233
end
3334

3435
test do
3536
require "pty"
3637

38+
(testpath/"data.txt").write <<~EOS
39+
Homebrew test
40+
Homebrew Spark test
41+
Spark test Homebrew
42+
EOS
43+
3744
output = ""
3845
PTY.spawn(bin/"spark-shell") do |r, w, pid|
3946
w.puts "sc.parallelize(1 to 1000).count()"
40-
w.puts "jdk.incubator.foreign.FunctionDescriptor.TRIVIAL_ATTRIBUTE_NAME"
47+
w.puts 'sc.textFile("data.txt").filter(line => line.contains("Spark")).first()'
4148
w.puts ":quit"
4249
begin
4350
r.each_line { |line| output += line }
@@ -55,6 +62,6 @@ def install
5562
end
5663

5764
assert_match "Long = 1000", output
58-
assert_match "String = abi/trivial", output
65+
assert_match "String = Homebrew Spark test", output
5966
end
6067
end

0 commit comments

Comments
 (0)