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

[jira] [Created] (SPARK-37076) Implements StructType.toString explicitly for Scala 2.13

Kousuke Saruta created SPARK-37076:
--------------------------------------

             Summary: Implements 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


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