You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by Alana Young <ay...@dtechspace.com> on 2022/01/13 14:35:42 UTC

Spark Unary Transformer Example

I am trying to run the Unary Transformer example provided by Spark (https://github.com/apache/spark/blob/v3.1.2/examples/src/main/scala/org/apache/spark/examples/ml/UnaryTransformerExample.scala <https://github.com/apache/spark/blob/v3.1.2/examples/src/main/scala/org/apache/spark/examples/ml/UnaryTransformerExample.scala>). I created a Zeppelin notebook and copied and pasted the example. The only change I made was to save and load the transformer to/from a predefined directory instead of creating a temporary directory. I am able to save the transformer, but am running into the following exception when loading the saved transformer (line 108):

java.lang.NoSuchMethodException: UnaryTransformerExample$MyTransformer.<init>(java.lang.String)
  at java.base/java.lang.Class.getConstructor0(Class.java:3349)
  at java.base/java.lang.Class.getConstructor(Class.java:2151)
  at org.apache.spark.ml.util.DefaultParamsReader.load(ReadWrite.scala:468)
  at org.apache.spark.ml.util.MLReadable.load(ReadWrite.scala:355)
  at org.apache.spark.ml.util.MLReadable.load$(ReadWrite.scala:355)
  at UnaryTransformerExample$MyTransformer$.load(<console>:84)
  at UnaryTransformerExample$.main(<console>:109)
  ... 44 elided

Any feedback is appreciated. Thank you.

Additional Details

Spark Version: 3.1.2
Zeppelin Version: 0.9.0