java.lang.UnsupportedOperationException: No Encoder found for com.company.MyEnum.Value - field (class: "scala.Enumeration.Value", name: "other") - root class: "com.company.MyData"

Stack Overflow | ErikHabanero | 5 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    How to create Spark Dataset or Dataframe from case classes that contains Enums

    Stack Overflow | 5 months ago | ErikHabanero
    java.lang.UnsupportedOperationException: No Encoder found for com.company.MyEnum.Value - field (class: "scala.Enumeration.Value", name: "other") - root class: "com.company.MyData"
  2. 0

    How can I use Spark Dataset with Thrift

    Stack Overflow | 1 year ago | Davi
    java.lang.UnsupportedOperationException: No Encoder found for org.apache.thrift.protocol.TField - field (class: "org.apache.thrift.protocol.TField", name: "field") - array element class: "com.twitter.scrooge.TFieldBlob" - field (class: "scala.collection.immutable.Map", name: "_passthroughFields") - root class: "com.worldsense.scalathrift.ThriftRange.Immutable"

    Root Cause Analysis

    1. java.lang.UnsupportedOperationException

      No Encoder found for com.company.MyEnum.Value - field (class: "scala.Enumeration.Value", name: "other") - root class: "com.company.MyData"

      at org.apache.spark.sql.catalyst.ScalaReflection$.org$apache$spark$sql$catalyst$ScalaReflection$$extractorFor()
    2. Spark Project Catalyst
      ScalaReflection$$anonfun$org$apache$spark$sql$catalyst$ScalaReflection$$extractorFor$1.apply
      1. org.apache.spark.sql.catalyst.ScalaReflection$.org$apache$spark$sql$catalyst$ScalaReflection$$extractorFor(ScalaReflection.scala:597)
      2. org.apache.spark.sql.catalyst.ScalaReflection$$anonfun$org$apache$spark$sql$catalyst$ScalaReflection$$extractorFor$1.apply(ScalaReflection.scala:509)
      3. org.apache.spark.sql.catalyst.ScalaReflection$$anonfun$org$apache$spark$sql$catalyst$ScalaReflection$$extractorFor$1.apply(ScalaReflection.scala:502)
      3 frames
    3. Scala
      AbstractTraversable.flatMap
      1. scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
      2. scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
      3. scala.collection.immutable.List.foreach(List.scala:318)
      4. scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:251)
      5. scala.collection.AbstractTraversable.flatMap(Traversable.scala:105)
      5 frames
    4. Spark Project Catalyst
      ScalaReflection$.extractorsFor
      1. org.apache.spark.sql.catalyst.ScalaReflection$.org$apache$spark$sql$catalyst$ScalaReflection$$extractorFor(ScalaReflection.scala:502)
      2. org.apache.spark.sql.catalyst.ScalaReflection$.extractorsFor(ScalaReflection.scala:394)
      2 frames
    5. org.apache.spark
      ExpressionEncoder$.apply
      1. org.apache.spark.sql.catalyst.encoders.ExpressionEncoder$.apply(ExpressionEncoder.scala:54)
      1 frame
    6. Spark Project SQL
      SQLImplicits.newProductEncoder
      1. org.apache.spark.sql.SQLImplicits.newProductEncoder(SQLImplicits.scala:41)
      1 frame
    7. com.company
      EnumTest.main
      1. com.company.EnumTest$.main(EnumTest.scala:22)
      2. com.company.EnumTest.main(EnumTest.scala)
      2 frames
    8. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:497)
      4 frames
    9. IDEA
      AppMain.main
      1. com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
      1 frame