You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (Jira)" <ji...@apache.org> on 2021/10/21 04:50:00 UTC

[jira] [Resolved] (SPARK-37076) Implement StructType.toString explicitly for Scala 2.13

     [ https://issues.apache.org/jira/browse/SPARK-37076?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hyukjin Kwon resolved SPARK-37076.
----------------------------------
    Fix Version/s: 3.3.0
       Resolution: Fixed

Issue resolved by pull request 34341
[https://github.com/apache/spark/pull/34341]

> Implement StructType.toString explicitly for Scala 2.13
> -------------------------------------------------------
>
>                 Key: SPARK-37076
>                 URL: https://issues.apache.org/jira/browse/SPARK-37076
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.3.0
>         Environment: 
>            Reporter: Kousuke Saruta
>            Assignee: Kousuke Saruta
>            Priority: Minor
>             Fix For: 3.3.0
>
>
> The string returned by StructType.toString is different  between Scala 2.12 and 2.13.
> * Scala 2.12
> {code}
> val st = StructType(StructField("a", IntegerType) :: Nil)
> st.toString
> res0: String = StructType(StructField(a,IntegerType,true)
> {code}
> * Scala 2.13
> {code}
> val st = StructType(StructField("a", IntegerType) :: Nil)
> st.toString
> val res0: String = Seq(StructField(a,IntegerType,true))
> {code}
> It's because the logic to make the prefix of the string was changed from Scala 2.13.
> Scala 2.12: https://github.com/scala/scala/blob/v2.12.15/src/library/scala/collection/TraversableLike.scala#L804
> Scala 2:13:https://github.com/scala/scala/blob/v2.13.5/src/library/scala/collection/Seq.scala#L46



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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