Details
-
Bug
-
Status: Resolved
-
Critical
-
Resolution: Duplicate
-
2.0.0
-
None
-
None
Description
When I have a `Map` inside a case class and am trying to use Datasets,
the simplest operation throws an exception, because the generated code is looking for a constructor with `scala.collection.Map` whereas the constructor takes `scala.collection.immutable.Map`.
To reproduce:
case class Bug(bug: Map[String, String]) val ds = Seq(Bug(Map("name" -> "dummy"))).toDS() ds.map { b => b.bug.getOrElse("name", null) }.count()
Stacktrace:
Caused by: java.util.concurrent.ExecutionException: java.lang.Exception: failed to compile: org.codehaus.commons.compiler.CompileException: File 'generated.java', Line 163, Column 150: No applicable constructor/method found for actual parameters "scala.collection.Map"; candidates are: Bug(scala.collection.immutable.Map)"
Attachments
Attachments
Issue Links
- duplicates
-
SPARK-18717 Datasets - crash (compile exception) when mapping to immutable scala map
- Resolved