From 1a62e6a2c119df707f15101b03ecff0c3dee62f5 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Mon, 13 Sep 2021 11:06:50 -0500 Subject: [PATCH] [SPARK-36712][BUILD] Make scala-parallel-collections in 2.13 POM a direct dependency (not in maven profile) As [reported on `devspark.apache.org`](https://lists.apache.org/thread.html/r84cff66217de438f1389899e6d6891b573780159cd45463acf3657aa%40%3Cdev.spark.apache.org%3E), the published POMs when building with Scala 2.13 have the `scala-parallel-collections` dependency only in the `scala-2.13` profile of the pom. ### What changes were proposed in this pull request? This PR suggests to work around this by un-commenting the `scala-parallel-collections` dependency when switching to 2.13 using the the `change-scala-version.sh` script. I included an upgrade to scala-parallel-collections version 1.0.3, the changes compared to 0.2.0 are minor. - removed OSGi metadata - renamed some internal inner classes - added `Automatic-Module-Name` ### Why are the changes needed? According to the posts, this solves issues for developers that write unit tests for their applications. Stephen Coy suggested to use the https://www.mojohaus.org/flatten-maven-plugin. While this sounds like a more principled solution, it is possibly too risky to do at this specific point in time? ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Locally Closes #33948 from lrytz/parCollDep. Authored-by: Lukas Rytz Signed-off-by: Sean Owen --- core/pom.xml | 15 ++++++--------- dev/change-scala-version.sh | 12 ++++++++---- external/avro/pom.xml | 17 ++++++----------- external/kafka-0-10-sql/pom.xml | 17 ++++++----------- external/kafka-0-10/pom.xml | 18 ++++++------------ mllib/pom.xml | 18 ++++++------------ pom.xml | 16 +++++++--------- sql/catalyst/pom.xml | 18 ++++++------------ sql/core/pom.xml | 15 ++++++--------- sql/hive-thriftserver/pom.xml | 17 ++++++----------- sql/hive/pom.xml | 15 ++++++--------- streaming/pom.xml | 17 ++++++----------- 12 files changed, 75 insertions(+), 120 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index be449644fc..dbde22f2bf 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -35,6 +35,12 @@ + org.apache.avro avro @@ -639,15 +645,6 @@ - - scala-2.13 - - - org.scala-lang.modules - scala-parallel-collections_${scala.binary.version} - - - diff --git a/dev/change-scala-version.sh b/dev/change-scala-version.sh index 48b7f64751..e17a2249cc 100755 --- a/dev/change-scala-version.sh +++ b/dev/change-scala-version.sh @@ -54,11 +54,15 @@ sed_i() { sed -e "$1" "$2" > "$2.tmp" && mv "$2.tmp" "$2" } -export -f sed_i - BASEDIR=$(dirname $0)/.. -find "$BASEDIR" -name 'pom.xml' -not -path '*target*' -print \ - -exec bash -c "sed_i 's/\(artifactId.*\)_'$FROM_VERSION'/\1_'$TO_VERSION'/g' {}" \; +for f in $(find "$BASEDIR" -name 'pom.xml' -not -path '*target*'); do + echo $f + sed_i 's/\(artifactId.*\)_'$FROM_VERSION'/\1_'$TO_VERSION'/g' $f + sed_i 's/^\([[:space:]]*\)\(\)/\1\2/' $f + sed_i 's/^\([[:space:]]*\)/\1\)/\1-->\2/' $f +done # dependency:get is workaround for SPARK-34762 to download the JAR file of commons-cli. # Without this, build with Scala 2.13 using SBT will fail because the help plugin used below downloads only the POM file. diff --git a/external/avro/pom.xml b/external/avro/pom.xml index d9d358368f..7e414be577 100644 --- a/external/avro/pom.xml +++ b/external/avro/pom.xml @@ -70,22 +70,17 @@ org.apache.spark spark-tags_${scala.binary.version} + org.tukaani xz - - - scala-2.13 - - - org.scala-lang.modules - scala-parallel-collections_${scala.binary.version} - - - - target/scala-${scala.binary.version}/classes target/scala-${scala.binary.version}/test-classes diff --git a/external/kafka-0-10-sql/pom.xml b/external/kafka-0-10-sql/pom.xml index 8d505cf257..7bedcee613 100644 --- a/external/kafka-0-10-sql/pom.xml +++ b/external/kafka-0-10-sql/pom.xml @@ -74,6 +74,12 @@ test-jar test + org.apache.kafka kafka-clients @@ -169,17 +175,6 @@ - - - scala-2.13 - - - org.scala-lang.modules - scala-parallel-collections_${scala.binary.version} - - - - target/scala-${scala.binary.version}/classes target/scala-${scala.binary.version}/test-classes diff --git a/external/kafka-0-10/pom.xml b/external/kafka-0-10/pom.xml index 49f1befaf5..b689f2b02b 100644 --- a/external/kafka-0-10/pom.xml +++ b/external/kafka-0-10/pom.xml @@ -59,6 +59,12 @@ test-jar test + org.apache.kafka kafka-clients @@ -136,18 +142,6 @@ - - - scala-2.13 - - - org.scala-lang.modules - scala-parallel-collections_${scala.binary.version} - - - - - target/scala-${scala.binary.version}/classes target/scala-${scala.binary.version}/test-classes diff --git a/mllib/pom.xml b/mllib/pom.xml index e5889616dc..476226d514 100644 --- a/mllib/pom.xml +++ b/mllib/pom.xml @@ -91,6 +91,12 @@ test-jar test + org.scalanlp breeze_${scala.binary.version} @@ -157,18 +163,6 @@ - - - scala-2.13 - - - org.scala-lang.modules - scala-parallel-collections_${scala.binary.version} - - - - - target/scala-${scala.binary.version}/classes target/scala-${scala.binary.version}/test-classes diff --git a/pom.xml b/pom.xml index 87a275808f..c5cb837982 100644 --- a/pom.xml +++ b/pom.xml @@ -399,6 +399,13 @@ ${project.version} test-jar + com.twitter chill_${scala.binary.version} @@ -3370,15 +3377,6 @@ 2.13.5 2.13 - - - - org.scala-lang.modules - scala-parallel-collections_${scala.binary.version} - 0.2.0 - - - diff --git a/sql/catalyst/pom.xml b/sql/catalyst/pom.xml index c6612c4447..32281b52f3 100644 --- a/sql/catalyst/pom.xml +++ b/sql/catalyst/pom.xml @@ -87,6 +87,12 @@ spark-sketch_${scala.binary.version} ${project.version} + org.scalacheck scalacheck_${scala.binary.version} @@ -191,16 +197,4 @@ - - - - scala-2.13 - - - org.scala-lang.modules - scala-parallel-collections_${scala.binary.version} - - - - diff --git a/sql/core/pom.xml b/sql/core/pom.xml index 27260ce67a..f9c12d1cdb 100644 --- a/sql/core/pom.xml +++ b/sql/core/pom.xml @@ -90,6 +90,12 @@ test + org.apache.orc orc-core @@ -252,15 +258,6 @@ - - scala-2.13 - - - org.scala-lang.modules - scala-parallel-collections_${scala.binary.version} - - - hadoop-2.7 diff --git a/sql/hive-thriftserver/pom.xml b/sql/hive-thriftserver/pom.xml index e14017ecf5..764712fcbb 100644 --- a/sql/hive-thriftserver/pom.xml +++ b/sql/hive-thriftserver/pom.xml @@ -61,6 +61,12 @@ test-jar test + com.google.guava guava @@ -138,17 +144,6 @@ commons-cli - - - scala-2.13 - - - org.scala-lang.modules - scala-parallel-collections_${scala.binary.version} - - - - target/scala-${scala.binary.version}/classes target/scala-${scala.binary.version}/test-classes diff --git a/sql/hive/pom.xml b/sql/hive/pom.xml index 526df643c0..86cd1eddde 100644 --- a/sql/hive/pom.xml +++ b/sql/hive/pom.xml @@ -79,6 +79,12 @@ test-jar test +