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

Support nested arrays/seqs in Datasets

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.2.0
    • SQL
    • None

    Description

      Nested arrays and seqs are not supported in Datasets:

      scala> spark.createDataset(Seq(Array(Array(1))))
      <console>:24: error: Unable to find encoder for type stored in a Dataset.  Primitive types (Int, String, etc) and Product types (case classes) are supported by importing spark.implicits._  Support for serializing other types will be added in future releases.
             spark.createDataset(Seq(Array(Array(1))))
                                ^
      
      scala> Seq(Array(Array(1))).toDS()
      <console>:24: error: value toDS is not a member of Seq[Array[Array[Int]]]
             Seq(Array(Array(1))).toDS()
      
      scala> spark.createDataset(Seq(Seq(Seq(1))))
      <console>:24: error: Unable to find encoder for type stored in a Dataset.  Primitive types (Int, String, etc) and Product types (case classes) are supported by importing spark.implicits._  Support for serializing other types will be added in future releases.
             spark.createDataset(Seq(Seq(Seq(1))))
      
      scala> Seq(Seq(Seq(1))).toDS()
      <console>:24: error: value toDS is not a member of Seq[Seq[Seq[Int]]]
             Seq(Seq(Seq(1))).toDS()
      

      Attachments

        Issue Links

          Activity

            People

              michalsenkyr Michal Šenkýř
              michalsenkyr Michal Šenkýř
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: