Skip to content

Commit

Permalink
[SPARK-45331][BUILD] Upgrade Scala to 2.13.12
Browse files Browse the repository at this point in the history
This pr aims to upgrade Scala from 2.13.11 to 2.13.12.

Additionally, this pr adds ``-Wconf:msg=legacy-binding:s`` to suppress similar compiler warnings as below:

```
[ERROR] /Users/yangjie01/SourceCode/git/spark-mine-13/core/src/main/scala/org/apache/spark/deploy/client/StandaloneAppClient.scala:171: reference to stop is ambiguous;
it is both defined in the enclosing class StandaloneAppClient and inherited in the enclosing class ClientEndpoint as method stop (defined in trait RpcEndpoint, inherited through parent trait ThreadSafeRpcEndpoint)
In Scala 2, symbols inherited from a superclass shadow symbols defined in an outer scope.
Such references are ambiguous in Scala 3. To continue using the inherited symbol, write `this.stop`.
Or use `-Wconf:msg=legacy-binding:s` to silence this warning. [quickfixable]
Applicable -Wconf / nowarn filters for this fatal warning: msg=<part of the message>, cat=other, site=org.apache.spark.deploy.client.StandaloneAppClient.ClientEndpoint.receive
```

The new version bring some regression fixes:
- scala/scala#10422
- scala/scala#10424

And a new feature: Quickfixes
```
For some errors and warnings, the compiler now suggests an edit that could fix the issue. Tooling such as IDEs can then offer the edits, or the compiler itself will make the change if run again with -quickfix.
```
- scala/scala#10406
- scala/scala#10482
- scala/scala#10484

The release notes as follows:
- https://github.com/scala/scala/releases/tag/v2.13.12

Yes, Scala version changed.

Pass Github

NO

Closes apache#43185 from LuciferYang/SPARK-45331.

Authored-by: yangjie01 <yangjie01@baidu.com>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
  • Loading branch information
LuciferYang authored and dongjoon-hyun committed Jun 20, 2024
1 parent cfed724 commit f6e1bf3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
6 changes: 3 additions & 3 deletions dev/deps/spark-deps-hadoop-3-hive-2.3
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,11 @@ py4j/0.10.9.7//py4j-0.10.9.7.jar
remotetea-oncrpc/1.1.2//remotetea-oncrpc-1.1.2.jar
rocksdbjni/7.10.2//rocksdbjni-7.10.2.jar
scala-collection-compat_2.13/2.7.0//scala-collection-compat_2.13-2.7.0.jar
scala-compiler/2.13.11//scala-compiler-2.13.11.jar
scala-library/2.13.11//scala-library-2.13.11.jar
scala-compiler/2.13.12//scala-compiler-2.13.12.jar
scala-library/2.13.12//scala-library-2.13.12.jar
scala-parallel-collections_2.13/1.0.4//scala-parallel-collections_2.13-1.0.4.jar
scala-parser-combinators_2.13/2.1.1//scala-parser-combinators_2.13-2.1.1.jar
scala-reflect/2.13.11//scala-reflect-2.13.11.jar
scala-reflect/2.13.12//scala-reflect-2.13.12.jar
scala-xml_2.13/2.1.0//scala-xml_2.13-2.1.0.jar
shims/0.9.38//shims-0.9.38.jar
slf4j-api/2.0.6//slf4j-api-2.0.6.jar
Expand Down
11 changes: 9 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3821,7 +3821,7 @@
<profile>
<id>scala-2.13</id>
<properties>
<scala.version>2.13.11</scala.version>
<scala.version>2.13.12</scala.version>
<scala.binary.version>2.13</scala.binary.version>
</properties>
<build>
Expand All @@ -3847,7 +3847,7 @@
<arg>-Wconf:cat=other-nullary-override:wv</arg>
<arg>-Wconf:cat=other-match-analysis&amp;site=org.apache.spark.sql.catalyst.catalog.SessionCatalog.lookupFunction.catalogFunction:wv</arg>
<arg>-Wconf:cat=other-pure-statement&amp;site=org.apache.spark.streaming.util.FileBasedWriteAheadLog.readAll.readFile:wv</arg>
<arg>-Wconf:cat=other-pure-statement&amp;site=org.apache.spark.scheduler.OutputCommitCoordinatorSuite.&lt;local OutputCommitCoordinatorSuite&gt;.futureAction:wv</arg>
<arg>-Wconf:cat=other-pure-statement&amp;site=org.apache.spark.scheduler.OutputCommitCoordinatorSuite:wv</arg>
<!--
SPARK-33775 Suppress compilation warnings that contain the following contents.
TODO(SPARK-33805): Undo the corresponding deprecated usage suppression rule after fixed.
Expand Down Expand Up @@ -3878,6 +3878,13 @@
SPARK-40497 Upgrade Scala to 2.13.11 and suppress `Implicit definition should have explicit type`
-->
<arg>-Wconf:msg=Implicit definition should have explicit type:s</arg>
<!--
SPARK-45331 Upgrade Scala to 2.13.12 and suppress "In Scala 2, symbols inherited
from a superclass shadow symbols defined in an outer scope. Such references are
ambiguous in Scala 3. To continue using the inherited symbol, write `this.stop`.
Or use `-Wconf:msg=legacy-binding:s` to silence this warning. [quickfixable]"
-->
<arg>-Wconf:msg=legacy-binding:s</arg>
</args>
<compilerPlugins combine.self="override">
</compilerPlugins>
Expand Down
9 changes: 7 additions & 2 deletions project/SparkBuild.scala
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ object SparkBuild extends PomBuild {
"-Wconf:cat=other-nullary-override:wv",
"-Wconf:cat=other-match-analysis&site=org.apache.spark.sql.catalyst.catalog.SessionCatalog.lookupFunction.catalogFunction:wv",
"-Wconf:cat=other-pure-statement&site=org.apache.spark.streaming.util.FileBasedWriteAheadLog.readAll.readFile:wv",
"-Wconf:cat=other-pure-statement&site=org.apache.spark.scheduler.OutputCommitCoordinatorSuite.<local OutputCommitCoordinatorSuite>.futureAction:wv",
"-Wconf:cat=other-pure-statement&site=org.apache.spark.scheduler.OutputCommitCoordinatorSuite:wv",
"-Wconf:cat=other-pure-statement&site=org.apache.spark.sql.streaming.sources.StreamingDataSourceV2Suite.testPositiveCase.\\$anonfun:wv",
// SPARK-33775 Suppress compilation warnings that contain the following contents.
// TODO(SPARK-33805): Undo the corresponding deprecated usage suppression rule after
Expand All @@ -289,7 +289,12 @@ object SparkBuild extends PomBuild {
"-Wconf:cat=unchecked&msg=eliminated by erasure:s",
"-Wconf:msg=^(?=.*?a value of type)(?=.*?cannot also be).+$:s",
// SPARK-40497 Upgrade Scala to 2.13.11 and suppress `Implicit definition should have explicit type`
"-Wconf:msg=Implicit definition should have explicit type:s"
"-Wconf:msg=Implicit definition should have explicit type:s",
// SPARK-45331 Upgrade Scala to 2.13.12 and suppress "In Scala 2, symbols inherited
// from a superclass shadow symbols defined in an outer scope. Such references are
// ambiguous in Scala 3. To continue using the inherited symbol, write `this.stop`.
// Or use `-Wconf:msg=legacy-binding:s` to silence this warning. [quickfixable]"
"-Wconf:msg=legacy-binding:s"
)
}
}
Expand Down

0 comments on commit f6e1bf3

Please sign in to comment.