Skip to content

[SPARK-45512][CORE][SQL][SS][DSTREAM] Fix compilation warnings related to other-nullary-override#43332

Closed
LuciferYang wants to merge 8 commits intoapache:masterfrom
LuciferYang:other-nullary-override
Closed

[SPARK-45512][CORE][SQL][SS][DSTREAM] Fix compilation warnings related to other-nullary-override#43332
LuciferYang wants to merge 8 commits intoapache:masterfrom
LuciferYang:other-nullary-override

Conversation

@LuciferYang
Copy link
Copy Markdown
Contributor

@LuciferYang LuciferYang commented Oct 11, 2023

What changes were proposed in this pull request?

This PR fixes two compilation warnings related to other-nullary-override

[error] /Users/yangjie01/SourceCode/git/spark-mine-sbt/connector/connect/common/src/main/scala/org/apache/spark/sql/connect/client/CloseableIterator.scala:36:16: method with a single empty parameter list overrides method hasNext in trait Iterator defined without a parameter list [quickfixable]
[error] Applicable -Wconf / @nowarn filters for this fatal warning: msg=<part of the message>, cat=other-nullary-override, site=org.apache.spark.sql.connect.client.WrappedCloseableIterator
[error]   override def hasNext(): Boolean = innerIterator.hasNext
[error]                ^
[error] /Users/yangjie01/SourceCode/git/spark-mine-sbt/connector/connect/common/src/main/scala/org/apache/spark/sql/connect/client/ExecutePlanResponseReattachableIterator.scala:136:16: method without a parameter list overrides method hasNext in class WrappedCloseableIterator defined with a single empty parameter list [quickfixable]
[error] Applicable -Wconf / @nowarn filters for this fatal warning: msg=<part of the message>, cat=other-nullary-override, site=org.apache.spark.sql.connect.client.ExecutePlanResponseReattachableIterator
[error]   override def hasNext: Boolean = synchronized {
[error]                ^
[error] /Users/yangjie01/SourceCode/git/spark-mine-sbt/connector/connect/common/src/main/scala/org/apache/spark/sql/connect/client/GrpcExceptionConverter.scala:73:20: method without a parameter list overrides method hasNext in class WrappedCloseableIterator defined with a single empty parameter list [quickfixable]
[error] Applicable -Wconf / @nowarn filters for this fatal warning: msg=<part of the message>, cat=other-nullary-override, site=org.apache.spark.sql.connect.client.GrpcExceptionConverter.convertIterator
[error]       override def hasNext: Boolean = {
[error]                    ^
[error] /Users/yangjie01/SourceCode/git/spark-mine-sbt/connector/connect/common/src/main/scala/org/apache/spark/sql/connect/client/GrpcRetryHandler.scala:77:18: method without a parameter list overrides method next in class WrappedCloseableIterator defined with a single empty parameter list [quickfixable]
[error] Applicable -Wconf / @nowarn filters for this fatal warning: msg=<part of the message>, cat=other-nullary-override, site=org.apache.spark.sql.connect.client.GrpcRetryHandler.RetryIterator
[error]     override def next: U = {
[error]                  ^
[error] /Users/yangjie01/SourceCode/git/spark-mine-sbt/connector/connect/common/src/main/scala/org/apache/spark/sql/connect/client/GrpcRetryHandler.scala:81:18: method without a parameter list overrides method hasNext in class WrappedCloseableIterator defined with a single empty parameter list [quickfixable]
[error] Applicable -Wconf / @nowarn filters for this fatal warning: msg=<part of the message>, cat=other-nullary-override, site=org.apache.spark.sql.connect.client.GrpcRetryHandler.RetryIterator
[error]     override def hasNext: Boolean = {
[error]

and removes the corresponding suppression rules from the compilation options

"-Wconf:cat=other-nullary-override:wv",

On the other hand, the code corresponding to the following three suppression rules no longer exists, so the corresponding suppression rules were also cleaned up in this pr.

"-Wconf:cat=lint-multiarg-infix:wv",
"-Wconf:msg=method with a single empty parameter list overrides method without any parameter list:s",
"-Wconf:msg=method without a parameter list overrides a method with a single empty one:s",

Why are the changes needed?

Code clean up.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Pass GitHub Actions

Was this patch authored or co-authored using generative AI tooling?

No

@LuciferYang LuciferYang marked this pull request as draft October 11, 2023 15:08
@LuciferYang
Copy link
Copy Markdown
Contributor Author

Test first

@LuciferYang LuciferYang changed the title Fix compilation warnings related to lint-multiarg-infix/other-nullary-override Fix compilation warnings related to other-nullary-override Oct 12, 2023
@LuciferYang LuciferYang changed the title Fix compilation warnings related to other-nullary-override [SPARK-45512][CORE][SQL][SS][DSTREAM] Fix compilation warnings related to other-nullary-override Oct 12, 2023
@LuciferYang LuciferYang marked this pull request as ready for review October 12, 2023 08:12
Copy link
Copy Markdown
Member

@srowen srowen left a comment

Choose a reason for hiding this comment

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

Looks good pending tests

@LuciferYang
Copy link
Copy Markdown
Contributor Author

will re-trigger failed task later

@LuciferYang
Copy link
Copy Markdown
Contributor Author

friendly ping @srowen, All test passed, can we merge this one?

@srowen srowen closed this in 3b46cc8 Oct 17, 2023
@srowen
Copy link
Copy Markdown
Member

srowen commented Oct 17, 2023

Merged to master

@LuciferYang LuciferYang deleted the other-nullary-override branch October 18, 2023 05:24
baibaichen added a commit to baibaichen/gluten that referenced this pull request Dec 29, 2025
baibaichen added a commit to baibaichen/gluten that referenced this pull request Dec 29, 2025
baibaichen added a commit to baibaichen/gluten that referenced this pull request Dec 30, 2025
baibaichen added a commit to baibaichen/gluten that referenced this pull request Dec 30, 2025
baibaichen added a commit to apache/gluten that referenced this pull request Dec 31, 2025
* [Scala 2.13][IntelliJ] Remove suppression for lint-multiarg-infix warnings in pom.xml

see apache/spark#43332

* [Scala 2.13][IntelliJ] Suppress warning for `ContentFile::path`

* [Scala 2.13][IntelliJ] Suppress warning for ContextAwareIterator initialization

* [Scala 2.13][IntelliJ] Refactor to use Symbol for column references to fix compilation error in Scala 2.13 with IntelliJ compiler: symbol literal is deprecated; use Symbol("i")

* [Fix] Replace deprecated fileToString with Files.readString for file reading in GlutenSQLQueryTestSuite

see apache/spark#51911 which removes Spark's fileToString method from Spark code base.

* [Scala 2.13][IntelliJ] Update the Java compiler release version from 8 to `${java.version}` in the Scala 2.13 profiler to align it with `maven.compiler.target`

* [Refactor] Replace usage of `Symbol` with `col` for column references to align with Spark API best practices

---------

Co-authored-by: Chang chen <chenchang@apache.com>
QCLyu pushed a commit to QCLyu/incubator-gluten that referenced this pull request Jan 8, 2026
* [Scala 2.13][IntelliJ] Remove suppression for lint-multiarg-infix warnings in pom.xml

see apache/spark#43332

* [Scala 2.13][IntelliJ] Suppress warning for `ContentFile::path`

* [Scala 2.13][IntelliJ] Suppress warning for ContextAwareIterator initialization

* [Scala 2.13][IntelliJ] Refactor to use Symbol for column references to fix compilation error in Scala 2.13 with IntelliJ compiler: symbol literal is deprecated; use Symbol("i")

* [Fix] Replace deprecated fileToString with Files.readString for file reading in GlutenSQLQueryTestSuite

see apache/spark#51911 which removes Spark's fileToString method from Spark code base.

* [Scala 2.13][IntelliJ] Update the Java compiler release version from 8 to `${java.version}` in the Scala 2.13 profiler to align it with `maven.compiler.target`

* [Refactor] Replace usage of `Symbol` with `col` for column references to align with Spark API best practices

---------

Co-authored-by: Chang chen <chenchang@apache.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants