-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-30170][SQL][MLLIB][TESTS] Eliminate compilation warnings: part 1 #26799
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
Conversation
|
Test build #114995 has finished for PR 26799 at commit
|
mllib/src/test/scala/org/apache/spark/ml/feature/StopWordsRemoverSuite.scala
Show resolved
Hide resolved
| case binAttr: BinaryAttribute => Some(2) | ||
| case nomAttr: NominalAttribute => nomAttr.getNumValues | ||
| case unknown => | ||
| throw new IllegalArgumentException(s"Attribute type: ${unknown.getClass.getName}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Warning:Warning:line (88)match may not be exhaustive.
It would fail on the following inputs: NumericAttribute(), UnresolvedAttribute
val n = Attribute.fromStructField(dataframe.schema(colName)) match {
| val plan = Project(Seq(func), testRelation) | ||
| analyzer.execute(plan) | ||
| verifyZeroInteractions(catalog) | ||
| verifyNoInteractions(catalog) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Warning:Warning:line (62)method verifyZeroInteractions in class Mockito is deprecated: see corresponding Javadoc for more information.
verifyZeroInteractions(catalog)
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/csv/CSVExprUtilsSuite.scala
Show resolved
Hide resolved
| import java.util.TimeZone | ||
|
|
||
| import scala.util.Random | ||
| import scala.language.implicitConversions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Warning:Warning:line (39)implicit conversion method stringToUTF8Str should be enabled
by making the implicit value scala.language.implicitConversions visible.
This can be achieved by adding the import clause 'import scala.language.implicitConversions'
or by setting the compiler option -language:implicitConversions.
See the Scaladoc for value scala.language.implicitConversions for a discussion
why the feature should be explicitly enabled.
implicit def stringToUTF8Str(str: String): UTF8String = UTF8String.fromString(str)
|
Test build #114996 has finished for PR 26799 at commit
|
|
Since this PR has both |
I was trying to fix everything except of warnings in Kafka connector, Parquet datasource and deprecation warnings from Spark itself. Other parts should cover those warnings. |
|
Up to you about what is most efficient. If it's a bunch of misc tiny issues, you can put them together. The only thing I try to do is not split solutions to the same class of problem over two PRs if it's easy not to. For example for Scala 2.13 there are like 10+ distinct types of change. For anything important or touching many files I do one PR. But for the last few that involve a file or two each will probably batch them together. |
I did exactly the same. Originally I tried to fix warnings in JSON datasource here but I saw they became heavy, and put them to the separate PR: #26797 . Other fixes are comparably small, and put all of them to this PR. |
dongjoon-hyun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @MaxGekk .
Let's revert sql/catalyst/src/main/scala/org/apache/spark/sql/types/FloatType.scala and put [TESTS] into the PR title. For the others, looks good.
Just in case, @srowen are you ok to revert this? |
|
Merged to master. I have some questions about the umbrella JIRA: I think these need more descriptive names and I'm not sure all of those warnings can be resolved without removing tests for code we still need to test. |
What changes were proposed in this pull request?
Seq[String]bySeq[_]inStopWordsRemoverSuitebecauseStringtype is unchecked due erasure.MLTest.checkNominalOnDFbecause we don't expect other attribute types currently.BigDecimal(y). This is what theapply()method does forfloats.verifyZeroInteractionsbyverifyNoInteractions.\0by\u0000inCSVExprUtilsSuitescala.language.implicitConversionsinCollectionExpressionsSuite,HashExpressionsSuiteand inExpressionParserSuite.Why are the changes needed?
The changes fix compiler warnings showed in the JIRA ticket https://issues.apache.org/jira/browse/SPARK-30170 . Eliminating the warning highlights other warnings which could take more attention to real problems.
Does this PR introduce any user-facing change?
No
How was this patch tested?
By existing test suites
StopWordsRemoverSuite,AnalysisExternalCatalogSuite,CSVExprUtilsSuite,CollectionExpressionsSuite,HashExpressionsSuite,ExpressionParserSuiteand sub-tests ofMLTest.