Skip to content

Investigate coproducts #4

@BenFradet

Description

@BenFradet
  • not supported by Spark:
sealed trait A
final case class B(b: Int) extends A
final case class C(c: String) extends A
spark.createDataset(Seq(B(1), C("c")))
// java.lang.NoClassDefFoundError: no Java class corresponding to Product with Serializable with A found
  • might still be useful if not converting to dataset / see if frameless can be useful here

  • should either be:

StructType(
  StructField("B", StructType(StructField("b", IntegerType) :: Nil) ::
  StructField("C", StructType(StructField("c", StringType) :: Nil) :: Nil
)

or flattened set:

StructType(
  StructField("b", IntegerType) ::
  StructField("c", StringType) :: Nil
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions