HeartSaVioR opened a new pull request #33085:
URL: https://github.com/apache/spark/pull/33085


   ### What changes were proposed in this pull request?
   
   This PR proposes to add a new scalastyle rule to enforce not importing 
`scala.collection.Seq` and `scala.collection.IndexedSeq` which conflicts with 
`scala.Seq` and `scala.IndexedSeq`.
   
   The problem occurs as Scala 2.13 changed the alias of `scala.Seq` and 
`scala.IndexedSeq`. Before Scala 2.13, they were `scala.collection.Seq` and 
`scala.collection.IndexedSeq`. After Scala 2.13, they become 
`scala.collection.immutable.Seq` and `scala.collection.immutable.IndexedSeq`.
   
   Please refer below doc for more details.
   https://docs.scala-lang.org/overviews/core/collections-migration-213.html
   
   ### Why are the changes needed?
   
   We have seen Seq/IndexedSeq issues on cross-compilation of Scala 2.12 / 
2.13. While I'm not sure this can prevent all cases, this will prevent the 
simple case of breaking cross compilation.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No end user change. Contributors will be restricted but shouldn't block them 
doing the right thing.
   
   ### How was this patch tested?
   
   Ran scalastyle against current master (before #33084)
   
   ```
   > dev/scalastyle
   Scalastyle checks failed at following occurrences:
   [error] 
/Users/Jungtaek.Lim/WorkArea/ScalaProjects/spark-apache/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/RocksDBFileManager.scala:28:0:
   [error]       Don't import scala.collection.Seq and 
scala.collection.IndexedSeq as it may bring some problems with cross-build 
between Scala 2.12 and 2.13.
   [error]
   [error]       Please refer below page to see the details of changes around 
Seq.
   [error]       
https://docs.scala-lang.org/overviews/core/collections-migration-213.html
   [error]
   [error]       If you really need to use scala.collection.Seq or 
scala.collection.IndexedSeq, please use the fully-qualified name instead.
   [error]
   [error] 
/Users/Jungtaek.Lim/WorkArea/ScalaProjects/spark-apache/core/src/main/scala/org/apache/spark/util/Utils.scala:37:0:
   [error]       Don't import scala.collection.Seq and 
scala.collection.IndexedSeq as it may bring some problems with cross-build 
between Scala 2.12 and 2.13.
   [error]
   [error]       Please refer below page to see the details of changes around 
Seq.
   [error]       
https://docs.scala-lang.org/overviews/core/collections-migration-213.html
   [error]
   [error]       If you really need to use scala.collection.Seq or 
scala.collection.IndexedSeq, please use the fully-qualified name instead.
   [error]
   [error] Total time: 15 s, completed Jun 25, 2021 9:01:32 PM
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to