java.lang.UnsupportedOperationException

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

Solutions on the web860

  • No Encoder found for com.company.MyEnum.Value - field (class: "scala.Enumeration.Value", name: "other") - root class: "com.company.MyData"
  • No Encoder found for java.security.Timestamp - field (class: "java.security.Timestamp", name: "timestampval") - root class: "OraTest.HitBm"
  • No Encoder found for java.time.LocalDate - field (class: "java.time.LocalDate", name: "date") - root class: "observatory.TemperatureRow"
  • Stack trace

    • 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(ScalaReflection.scala:597) at org.apache.spark.sql.catalyst.ScalaReflection$$anonfun$org$apache$spark$sql$catalyst$ScalaReflection$$extractorFor$1.apply(ScalaReflection.scala:509) at org.apache.spark.sql.catalyst.ScalaReflection$$anonfun$org$apache$spark$sql$catalyst$ScalaReflection$$extractorFor$1.apply(ScalaReflection.scala:502) at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251) at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251) at scala.collection.immutable.List.foreach(List.scala:318) at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:251) at scala.collection.AbstractTraversable.flatMap(Traversable.scala:105) at org.apache.spark.sql.catalyst.ScalaReflection$.org$apache$spark$sql$catalyst$ScalaReflection$$extractorFor(ScalaReflection.scala:502) at org.apache.spark.sql.catalyst.ScalaReflection$.extractorsFor(ScalaReflection.scala:394) at org.apache.spark.sql.catalyst.encoders.ExpressionEncoder$.apply(ExpressionEncoder.scala:54) at org.apache.spark.sql.SQLImplicits.newProductEncoder(SQLImplicits.scala:41) at com.company.EnumTest$.main(EnumTest.scala:22) at com.company.EnumTest.main(EnumTest.scala) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    You are the first who have seen this exception. Write a tip to help other users and build your expert profile.