You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "jiaqi.zhu (Jira)" <ji...@apache.org> on 2023/12/12 03:17:00 UTC

[jira] [Created] (SPARK-46373) Create DataFrame Bug

jiaqi.zhu created SPARK-46373:
---------------------------------

             Summary: Create DataFrame Bug
                 Key: SPARK-46373
                 URL: https://issues.apache.org/jira/browse/SPARK-46373
             Project: Spark
          Issue Type: Bug
          Components: Spark Core
    Affects Versions: 3.5.0
            Reporter: jiaqi.zhu


Scala version is 3.3.1

Spark version is 3.5.0


I am using spark-core 3.5.1. I am trying to create a DataFrame through the reflection api, but "No TypeTag available for Person" will appear. I have tried for a long time, but I still don't quite understand why TypeTag cannot recognize my Person case class. 
{code:java}
    import sparkSession.implicits._
    import scala.reflect.runtime.universe._
    case class Person(name: String)
    val a = List(Person("A"), Person("B"), Person("C"))
    val df = sparkSession.createDataFrame(a)
    df.show(){code}
!https://media.discordapp.net/attachments/839723072239566878/1183747749204725821/image.png?ex=65897600&is=65770100&hm=4eeba8d8499499439590a34260f8b441c6594c572c545f5f61f8dc65beeb6a4b&=&format=webp&quality=lossless&width=1178&height=142!
I tested it and it is indeed a problem unique to Scala3
There is no problem on Scala2.13
 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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