Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-46373

Create DataFrame Bug

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.5.0
    • None
    • Spark Core
    • None

    Description

      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. 

          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()


      I tested it and it is indeed a problem unique to Scala3
      There is no problem on Scala2.13
       

      Attachments

        Activity

          People

            Unassigned Unassigned
            bleibtreu Bleibtreu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: