Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-33285][CORE][SQL] Fix deprecated compilation warnings of "Auto-application to () is deprecated" in Scala 2.13 #30234

Closed
wants to merge 39 commits into from

Conversation

LuciferYang
Copy link
Contributor

@LuciferYang LuciferYang commented Nov 3, 2020

What changes were proposed in this pull request?

The purpose of this pr is to partial resolve SPARK-33285.

Auto-application is dropped in Scala 3 and deprecated in 2.13.3 (scala/scala#8833) now. So we should add the parens when accessed empty-paren method.

For example, if definition as follows:

Class Foo {
   def bar(): Unit = {}
}
val foo = new Foo

foo.bar() is recommend , not foo.bar. So the main change of this pr is only add the parens where needed.

Why are the changes needed?

eliminate compilation warnings in Scala 2.13

Does this PR introduce any user-facing change?

No

How was this patch tested?

Pass the Jenkins or GitHub Action

@LuciferYang
Copy link
Contributor Author

cc @srowen this is the first part to fix this compilation warnings, if it's too big, I can split multiple small prs.

@SparkQA
Copy link

SparkQA commented Nov 3, 2020

Test build #130567 has finished for PR 30234 at commit eb84d5e.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@srowen
Copy link
Member

srowen commented Nov 3, 2020

Hoo boy that is a lot of code to touch. It sounds like eventually it has to happen for Scala 3 and avoids some deprecation noise. I'm not against it though as usual there is a minor concern about making patches harder to back port from 3.1 to 3.0 because of merge conflicts.

@SparkQA
Copy link

SparkQA commented Nov 3, 2020

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/35168/

@SparkQA
Copy link

SparkQA commented Nov 3, 2020

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/35168/

@SparkQA
Copy link

SparkQA commented Nov 3, 2020

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/35169/

@SparkQA
Copy link

SparkQA commented Nov 3, 2020

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/35169/

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LuciferYang .
After this PR, do we have a way to prevent this compilation warnings?

@SparkQA
Copy link

SparkQA commented Nov 3, 2020

Test build #130568 has finished for PR 30234 at commit dfe1a98.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for this PR, @LuciferYang .
However, shall we postpone this until Scala 2.13 becomes the default Scala version in Apache Spark?

@LuciferYang
Copy link
Contributor Author

LuciferYang commented Nov 4, 2020

@dongjoon-hyun

After this PR, do we have a way to prevent this compilation warnings?

It seems that there is no such way now.

However, shall we postpone this until Scala 2.13 becomes the default Scala version in Apache Spark?

Fixed this problem only because there are too many compilation warnings about this and it is compatible with Scala 2.12, and I agree with your suggestion

@LuciferYang
Copy link
Contributor Author

LuciferYang commented Nov 4, 2020

After this PR, do we have a way to prevent this compilation warnings?

Let me take a look at this problem. Maybe we can change the alarm level of the compiler or check-style plugin by modify some configuration

@dongjoon-hyun dongjoon-hyun marked this pull request as draft November 6, 2020 02:54
@SparkQA
Copy link

SparkQA commented Nov 6, 2020

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/35291/

@SparkQA
Copy link

SparkQA commented Nov 6, 2020

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/35291/

@SparkQA
Copy link

SparkQA commented Nov 6, 2020

Test build #130680 has finished for PR 30234 at commit 8881355.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

This reverts commit 8881355.
This reverts commit a8ac6bc.
@LuciferYang LuciferYang marked this pull request as ready for review November 18, 2020 07:16
@LuciferYang
Copy link
Contributor Author

@dongjoon-hyun It seems that except for RDD.isEmpty has been fixed.

@dongjoon-hyun
Copy link
Member

Sorry, but what do you mean?

It seems that except for RDD.isEmpty has been fixed.

@LuciferYang
Copy link
Contributor Author

LuciferYang commented Nov 18, 2020

seems all case has been fixed except for RDD.isEmpty relevant case

@SparkQA
Copy link

SparkQA commented Nov 18, 2020

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/35869/

@SparkQA
Copy link

SparkQA commented Nov 18, 2020

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/35869/

@SparkQA
Copy link

SparkQA commented Nov 18, 2020

Test build #131266 has finished for PR 30234 at commit 9284fdc.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@LuciferYang LuciferYang marked this pull request as draft November 19, 2020 09:43
@github-actions github-actions bot added the BUILD label Nov 19, 2020
@SparkQA
Copy link

SparkQA commented Nov 19, 2020

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/35945/

@SparkQA
Copy link

SparkQA commented Nov 19, 2020

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/35947/

@SparkQA
Copy link

SparkQA commented Nov 19, 2020

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/35945/

@SparkQA
Copy link

SparkQA commented Nov 19, 2020

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/35947/

@SparkQA
Copy link

SparkQA commented Nov 19, 2020

Test build #131341 has finished for PR 30234 at commit d8f1db0.

  • This patch fails Spark unit tests.
  • This patch does not merge cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Nov 19, 2020

Test build #131343 has finished for PR 30234 at commit 176d8fd.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • class ExecutorSource(
  • implicit class MetadataColumnsHelper(metadata: Array[MetadataColumn])

@SparkQA
Copy link

SparkQA commented Nov 19, 2020

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/35957/

@SparkQA
Copy link

SparkQA commented Nov 19, 2020

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/35957/

@SparkQA
Copy link

SparkQA commented Nov 19, 2020

Test build #131353 has finished for PR 30234 at commit 1a2b123.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Dec 14, 2020

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37366/

@SparkQA
Copy link

SparkQA commented Dec 14, 2020

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37366/

@SparkQA
Copy link

SparkQA commented Dec 14, 2020

Test build #132764 has finished for PR 30234 at commit 4253839.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@LuciferYang
Copy link
Contributor Author

Spark SPARK-33775 add some Scalac config to Suppress compilation warnings, no need to fix this now, close it first

@LuciferYang LuciferYang deleted the SPARK-33285.1 branch June 6, 2022 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment