Skip to content

Commit 3429202

Browse files
LuciferYangdongjoon-hyun
authored andcommitted
[SPARK-44113][BUILD][INFRA][DOCS] Drop support for Scala 2.12
### What changes were proposed in this pull request? The main purpose of this PR is to remove support for Scala 2.12 in Apache Spark 4.0, the specific work includes: 1. Run `dev/change-scala-version.sh 2.13` to change the Scala version in all `pom.xml` files to 2.13 2. Cleaned up the parent `pom.xml` configuration related to Scala 2.12 and set the Scala 2.13 configuration as the default 3. Cleaned up the Scala 2.12 configuration in `SparkBuild.scala` 4. Cleaned up the support for Scala 2.12 in `python/run-tests.py` and `dev/run-tests.py` 5. Updated the sections related to Scala 2.12 in `docs/building-spark.md`, `docs/index.md`,`docs/spark-connect-overview.md`,`docs/storage-openstack-swift.md`,`docs/_config.yml` to Scala 2.13 6. Updated the parts related to Scala 2.12 in `dev/test-dependencies.sh`, `dev/scalafmt`, `dev/mima`,`dev/lint-scala` to Scala 2.13 7. Removed the support for Scala 2.12 in `dev/change-scala-version.sh` and cleaned up its invocation in Spark code 8. Updated `dev/deps/spark-deps-hadoop-3-hive-2.3` and `LICENSE-binary` 9. Removed task `scala-213` from `build_and_test.yml` because the daily test of other branches will not run this task, and the master branch already uses Scala 2.13 by default. 10. Replaced Scala 2.12 with Scala 2.13 in the `name` of the following `.yml` files: `build_ansi.yml`, `build_coverage.yml`, `build_java11.yml`,`build_java17.yml`, `build_java21.yml`,`build_maven.yml`, and `build_rockdb_as_ui_backend.yml` 11. Removed the support for Scala 2.12 in `benchmark.yml` 12. Moved files from `src/scala-2.13/` directory to `src/main/scala` and deleted all files in the `src/scala-2.12/` directory. 13. Comment out the code related to multiple Scala versions in `load-spark-env.cmd` and `load-spark-env.sh`. 14. Clean up redundant `build-helper-maven-plugin` configurations from `core/pom.xml`, `repl/pom.xml`, `sql/api/pom.xml`, `sql/catalyst/pom.xml`, `sql/core/pom.xml` and `connector/connect/common/pom.xml` ### Why are the changes needed? The minimum supported Scala version for Apache Spark 4.0 is Scala 2.13. ### Does this PR introduce _any_ user-facing change? Yes, Apache will no longer support Scala 2.12 ### How was this patch tested? Pass GitHub Actions ### Was this patch authored or co-authored using generative AI tooling? No Closes apache#43008 from LuciferYang/SPARK-44113. Lead-authored-by: yangjie01 <[email protected]> Co-authored-by: YangJie <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent db02469 commit 3429202

File tree

96 files changed

+326
-1849
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+326
-1849
lines changed

.github/workflows/benchmark.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ on:
3131
required: true
3232
default: '8'
3333
scala:
34-
description: 'Scala version: 2.12 or 2.13'
34+
description: 'Scala version: 2.13'
3535
required: true
36-
default: '2.12'
36+
default: '2.13'
3737
failfast:
3838
description: 'Failfast: true or false'
3939
required: true
@@ -170,7 +170,6 @@ jobs:
170170
key: tpcds-${{ hashFiles('.github/workflows/benchmark.yml', 'sql/core/src/test/scala/org/apache/spark/sql/TPCDSSchema.scala') }}
171171
- name: Run benchmarks
172172
run: |
173-
dev/change-scala-version.sh ${{ github.event.inputs.scala }}
174173
./build/sbt -Pscala-${{ github.event.inputs.scala }} -Pyarn -Pmesos -Pkubernetes -Phive -Phive-thriftserver -Phadoop-cloud -Pkinesis-asl -Pspark-ganglia-lgpl Test/package
175174
# Make less noisy
176175
cp conf/log4j2.properties.template conf/log4j2.properties
@@ -181,8 +180,6 @@ jobs:
181180
--jars "`find . -name '*-SNAPSHOT-tests.jar' -o -name '*avro*-SNAPSHOT.jar' | paste -sd ',' -`" \
182181
"`find . -name 'spark-core*-SNAPSHOT-tests.jar'`" \
183182
"${{ github.event.inputs.class }}"
184-
# Revert to default Scala version to clean up unnecessary git diff
185-
dev/change-scala-version.sh 2.12
186183
# To keep the directory structure and file permissions, tar them
187184
# See also https://github.com/actions/upload-artifact#maintaining-file-permissions-and-case-sensitive-files
188185
echo "Preparing the benchmark results:"

.github/workflows/build_and_test.yml

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
sparkr=`./dev/is-changed.py -m sparkr`
8787
tpcds=`./dev/is-changed.py -m sql`
8888
docker=`./dev/is-changed.py -m docker-integration-tests`
89-
# 'build', 'scala-213', and 'java-other-versions' are always true for now.
89+
# 'build' and 'java-other-versions' are always true for now.
9090
# It does not save significant time and most of PRs trigger the build.
9191
precondition="
9292
{
@@ -95,7 +95,6 @@ jobs:
9595
\"sparkr\": \"$sparkr\",
9696
\"tpcds-1g\": \"$tpcds\",
9797
\"docker-integration-tests\": \"$docker\",
98-
\"scala-213\": \"true\",
9998
\"java-other-versions\": \"true\",
10099
\"lint\" : \"true\",
101100
\"k8s-integration-tests\" : \"true\",
@@ -828,53 +827,6 @@ jobs:
828827
./build/mvn $MAVEN_CLI_OPTS -DskipTests -Pyarn -Pmesos -Pkubernetes -Pvolcano -Phive -Phive-thriftserver -Phadoop-cloud -Djava.version=${JAVA_VERSION/-ea} install
829828
rm -rf ~/.m2/repository/org/apache/spark
830829
831-
scala-213:
832-
needs: precondition
833-
if: fromJson(needs.precondition.outputs.required).scala-213 == 'true'
834-
name: Scala 2.13 build with SBT
835-
runs-on: ubuntu-22.04
836-
timeout-minutes: 300
837-
steps:
838-
- name: Checkout Spark repository
839-
uses: actions/checkout@v3
840-
with:
841-
fetch-depth: 0
842-
repository: apache/spark
843-
ref: ${{ inputs.branch }}
844-
- name: Sync the current branch with the latest in Apache Spark
845-
if: github.repository != 'apache/spark'
846-
run: |
847-
git fetch https://github.com/$GITHUB_REPOSITORY.git ${GITHUB_REF#refs/heads/}
848-
git -c user.name='Apache Spark Test Account' -c user.email='[email protected]' merge --no-commit --progress --squash FETCH_HEAD
849-
git -c user.name='Apache Spark Test Account' -c user.email='[email protected]' commit -m "Merged commit" --allow-empty
850-
- name: Cache Scala, SBT and Maven
851-
uses: actions/cache@v3
852-
with:
853-
path: |
854-
build/apache-maven-*
855-
build/scala-*
856-
build/*.jar
857-
~/.sbt
858-
key: build-${{ hashFiles('**/pom.xml', 'project/build.properties', 'build/mvn', 'build/sbt', 'build/sbt-launch-lib.bash', 'build/spark-build-info') }}
859-
restore-keys: |
860-
build-
861-
- name: Cache Coursier local repository
862-
uses: actions/cache@v3
863-
with:
864-
path: ~/.cache/coursier
865-
key: scala-213-coursier-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }}
866-
restore-keys: |
867-
scala-213-coursier-
868-
- name: Install Java 8
869-
uses: actions/setup-java@v3
870-
with:
871-
distribution: zulu
872-
java-version: 8
873-
- name: Build with SBT
874-
run: |
875-
./dev/change-scala-version.sh 2.13
876-
./build/sbt -Pyarn -Pmesos -Pkubernetes -Pvolcano -Phive -Phive-thriftserver -Phadoop-cloud -Pkinesis-asl -Pdocker-integration-tests -Pkubernetes-integration-tests -Pspark-ganglia-lgpl -Pscala-2.13 compile Test/compile
877-
878830
# Any TPC-DS related updates on this job need to be applied to tpcds-1g-gen job of benchmark.yml as well
879831
tpcds-1g:
880832
needs: precondition

.github/workflows/build_ansi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# under the License.
1818
#
1919

20-
name: "Build / ANSI (master, Hadoop 3, JDK 8, Scala 2.12)"
20+
name: "Build / ANSI (master, Hadoop 3, JDK 8, Scala 2.13)"
2121

2222
on:
2323
schedule:

.github/workflows/build_coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# under the License.
1818
#
1919

20-
name: "Build / Coverage (master, Scala 2.12, Hadoop 3, JDK 8)"
20+
name: "Build / Coverage (master, Scala 2.13, Hadoop 3, JDK 8)"
2121

2222
on:
2323
schedule:

.github/workflows/build_java11.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# under the License.
1818
#
1919

20-
name: "Build (master, Scala 2.12, Hadoop 3, JDK 11)"
20+
name: "Build (master, Scala 2.13, Hadoop 3, JDK 11)"
2121

2222
on:
2323
schedule:

.github/workflows/build_java17.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# under the License.
1818
#
1919

20-
name: "Build (master, Scala 2.12, Hadoop 3, JDK 17)"
20+
name: "Build (master, Scala 2.13, Hadoop 3, JDK 17)"
2121

2222
on:
2323
schedule:

.github/workflows/build_java21.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# under the License.
1818
#
1919

20-
name: "Build (master, Scala 2.12, Hadoop 3, JDK 21)"
20+
name: "Build (master, Scala 2.13, Hadoop 3, JDK 21)"
2121

2222
on:
2323
schedule:

.github/workflows/build_maven.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# under the License.
1818
#
1919

20-
name: "Build using Maven (master, Scala 2.12, Hadoop 3, JDK 8)"
20+
name: "Build using Maven (master, Scala 2.13, Hadoop 3, JDK 8)"
2121

2222
on:
2323
schedule:

.github/workflows/build_rockdb_as_ui_backend.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# under the License.
1818
#
1919

20-
name: "Build / RocksDB as UI Backend (master, Hadoop 3, JDK 8, Scala 2.12)"
20+
name: "Build / RocksDB as UI Backend (master, Hadoop 3, JDK 8, Scala 2.13)"
2121

2222
on:
2323
schedule:

LICENSE-binary

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -209,34 +209,34 @@ org.apache.zookeeper:zookeeper
209209
oro:oro
210210
commons-configuration:commons-configuration
211211
commons-digester:commons-digester
212-
com.chuusai:shapeless_2.12
212+
com.chuusai:shapeless_2.13
213213
com.googlecode.javaewah:JavaEWAH
214214
com.twitter:chill-java
215-
com.twitter:chill_2.12
215+
com.twitter:chill_2.13
216216
com.univocity:univocity-parsers
217217
javax.jdo:jdo-api
218218
joda-time:joda-time
219219
net.sf.opencsv:opencsv
220220
org.apache.derby:derby
221221
org.objenesis:objenesis
222222
org.roaringbitmap:RoaringBitmap
223-
org.scalanlp:breeze-macros_2.12
224-
org.scalanlp:breeze_2.12
225-
org.typelevel:macro-compat_2.12
223+
org.scalanlp:breeze-macros_2.13
224+
org.scalanlp:breeze_2.13
225+
org.typelevel:macro-compat_2.13
226226
org.yaml:snakeyaml
227227
org.apache.xbean:xbean-asm7-shaded
228228
com.squareup.okhttp3:logging-interceptor
229229
com.squareup.okhttp3:okhttp
230230
com.squareup.okio:okio
231-
org.apache.spark:spark-catalyst_2.12
232-
org.apache.spark:spark-kvstore_2.12
233-
org.apache.spark:spark-launcher_2.12
234-
org.apache.spark:spark-mllib-local_2.12
235-
org.apache.spark:spark-network-common_2.12
236-
org.apache.spark:spark-network-shuffle_2.12
237-
org.apache.spark:spark-sketch_2.12
238-
org.apache.spark:spark-tags_2.12
239-
org.apache.spark:spark-unsafe_2.12
231+
org.apache.spark:spark-catalyst_2.13
232+
org.apache.spark:spark-kvstore_2.13
233+
org.apache.spark:spark-launcher_2.13
234+
org.apache.spark:spark-mllib-local_2.13
235+
org.apache.spark:spark-network-common_2.13
236+
org.apache.spark:spark-network-shuffle_2.13
237+
org.apache.spark:spark-sketch_2.13
238+
org.apache.spark:spark-tags_2.13
239+
org.apache.spark:spark-unsafe_2.13
240240
commons-httpclient:commons-httpclient
241241
com.vlkan:flatbuffers
242242
com.ning:compress-lzf
@@ -299,10 +299,10 @@ org.apache.orc:orc-mapreduce
299299
org.mortbay.jetty:jetty
300300
org.mortbay.jetty:jetty-util
301301
com.jolbox:bonecp
302-
org.json4s:json4s-ast_2.12
303-
org.json4s:json4s-core_2.12
304-
org.json4s:json4s-jackson_2.12
305-
org.json4s:json4s-scalap_2.12
302+
org.json4s:json4s-ast_2.13
303+
org.json4s:json4s-core_2.13
304+
org.json4s:json4s-jackson_2.13
305+
org.json4s:json4s-scalap_2.13
306306
com.carrotsearch:hppc
307307
com.fasterxml.jackson.core:jackson-annotations
308308
com.fasterxml.jackson.core:jackson-core
@@ -312,7 +312,7 @@ com.fasterxml.jackson.jaxrs:jackson-jaxrs-base
312312
com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider
313313
com.fasterxml.jackson.module:jackson-module-jaxb-annotations
314314
com.fasterxml.jackson.module:jackson-module-paranamer
315-
com.fasterxml.jackson.module:jackson-module-scala_2.12
315+
com.fasterxml.jackson.module:jackson-module-scala_2.13
316316
com.github.mifmif:generex
317317
com.google.code.findbugs:jsr305
318318
com.google.code.gson:gson
@@ -385,8 +385,8 @@ org.eclipse.jetty:jetty-xml
385385
org.scala-lang:scala-compiler
386386
org.scala-lang:scala-library
387387
org.scala-lang:scala-reflect
388-
org.scala-lang.modules:scala-parser-combinators_2.12
389-
org.scala-lang.modules:scala-xml_2.12
388+
org.scala-lang.modules:scala-parser-combinators_2.13
389+
org.scala-lang.modules:scala-xml_2.13
390390
com.github.joshelser:dropwizard-metrics-hadoop-metrics2-reporter
391391
com.zaxxer.HikariCP
392392
org.apache.hive:hive-beeline
@@ -471,19 +471,19 @@ MIT License
471471
-----------
472472

473473
com.microsoft.sqlserver:mssql-jdbc
474-
org.typelevel:spire_2.12
475-
org.typelevel:spire-macros_2.12
476-
org.typelevel:spire-platform_2.12
477-
org.typelevel:spire-util_2.12
478-
org.typelevel:algebra_2.12:jar
479-
org.typelevel:cats-kernel_2.12
480-
org.typelevel:machinist_2.12
474+
org.typelevel:spire_2.13
475+
org.typelevel:spire-macros_2.13
476+
org.typelevel:spire-platform_2.13
477+
org.typelevel:spire-util_2.13
478+
org.typelevel:algebra_2.13:jar
479+
org.typelevel:cats-kernel_2.13
480+
org.typelevel:machinist_2.13
481481
net.razorvine:pickle
482482
org.slf4j:jcl-over-slf4j
483483
org.slf4j:jul-to-slf4j
484484
org.slf4j:slf4j-api
485485
org.slf4j:slf4j-log4j12
486-
com.github.scopt:scopt_2.12
486+
com.github.scopt:scopt_2.13
487487
dev.ludovic.netlib:blas
488488
dev.ludovic.netlib:arpack
489489
dev.ludovic.netlib:lapack

0 commit comments

Comments
 (0)