[ 
https://issues.apache.org/jira/browse/SPARK-27681?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16838781#comment-16838781
 ] 

Sean Owen commented on SPARK-27681:
-----------------------------------

You're right, the change is kinda breaking! we can just accept that, or 
explicitly patch over the breaking change where we think it's important. I 
agree, using the convenient Seq alias is just going to keep happening, but 
doesn't mean we may not be explicit in cases where it matters enough, in a 
public API here or there.

(We won't be able to avoid fixing Spark methods that need to return a 
non-immutable Seq and return scala.Seq now, so there's at least that.)

Yep your example is just what we don't want to do. It just breaks things. The 
case to consider is, roughly, where Seq is an argument not a return type.

Yes, mutable and immutable Seqs have always been separate subtypes of 
scala.collection.Seq, and neither is or will be assignable to the other. Your 
example works in 2.12 but not in 2.13. But scala.collection.Seq is the parent 
of both mutable and immutable Seqs.

> Use scala.collection.Seq explicitly instead of scala.Seq alias
> --------------------------------------------------------------
>
>                 Key: SPARK-27681
>                 URL: https://issues.apache.org/jira/browse/SPARK-27681
>             Project: Spark
>          Issue Type: Sub-task
>          Components: ML, MLlib, Spark Core, SQL, Structured Streaming
>    Affects Versions: 3.0.0
>            Reporter: Sean Owen
>            Assignee: Sean Owen
>            Priority: Major
>
> {{scala.Seq}} is widely used in the code, and is an alias for 
> {{scala.collection.Seq}} in Scala 2.12. It will become an alias for 
> {{scala.collection.immutable.Seq}} in Scala 2.13. In many cases, this will be 
> fine, as Spark users using Scala 2.13 will also have this changed alias. In 
> some cases it may be undesirable, as it will cause some code to compile in 
> 2.12 but not in 2.13. In some cases, making the type {{scala.collection.Seq}} 
> explicit so that it doesn't vary can help avoid this, so that Spark apps 
> might cross-compile for 2.12 and 2.13 with the same source.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to