java.lang.IllegalArgumentException: Unsupported type org.apache.spark.mllib.linalg.VectorUDT@5172cce4

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Steps to reproduce: Follow [new spark ml api guide|http://spark.apache.org/docs/latest/ml-guide.html]: {code} val training = sparkContext.parallelize(Seq( LabeledDocument(0L, "a b c d e spark", 1.0), LabeledDocument(1L, "b d", 0.0), LabeledDocument(2L, "spark f g h", 1.0), LabeledDocument(3L, "hadoop mapreduce", 0.0))) // Configure an ML pipeline, which consists of three stages: tokenizer, hashingTF, and lr. val tokenizer = new Tokenizer() .setInputCol("text") .setOutputCol("words") val hashingTF = new HashingTF() .setNumFeatures(1000) .setInputCol(tokenizer.getOutputCol) .setOutputCol("features") val pipeline = new Pipeline().setStages(Array(tokenizer, hashingTF)) val model = pipeline.fit(training) val tranformed = model.transform(training) scala> transformed.schema res7: org.apache.spark.sql.StructType = StructType(ArrayBuffer(StructField(id,LongType,false), StructField(text,StringType,true), StructField(label,DoubleType,false), StructField(words,ArrayType(StringType,false),true), StructField(features,org.apache.spark.mllib.linalg.VectorUDT@5172cce4,true))) scala> toDataFrame(transformed) java.lang.IllegalArgumentException: Unsupported type ArrayType(StringType,false) at org.apache.spark.h2o.H2OContextUtils$.dataTypeToClass(H2OContextUtils.scala:175) at org.apache.spark.h2o.H2OContext$$anonfun$4.apply(H2OContext.scala:282) at org.apache.spark.h2o.H2OContext$$anonfun$4.apply(H2OContext.scala:282) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59) at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47) at scala.collection.TraversableLike$class.map(TraversableLike.scala:244) val transformed2 = transformed.select('features) scala> transformed2.schema res4: org.apache.spark.sql.StructType = StructType(ArrayBuffer(StructField(features,org.apache.spark.mllib.linalg.VectorUDT@5172cce4,true))) scala> toDataFrame(transformed2) java.lang.IllegalArgumentException: Unsupported type org.apache.spark.mllib.linalg.VectorUDT@5172cce4 at org.apache.spark.h2o.H2OContextUtils$.dataTypeToClass(H2OContextUtils.scala:175) at org.apache.spark.h2o.H2OContext$$anonfun$4.apply(H2OContext.scala:282) at org.apache.spark.h2o.H2OContext$$anonfun$4.apply(H2OContext.scala:282) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59) at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47) {code}
    via by Peter Rudenko,
  • Steps to reproduce: Follow [new spark ml api guide|http://spark.apache.org/docs/latest/ml-guide.html]: {code} val training = sparkContext.parallelize(Seq( LabeledDocument(0L, "a b c d e spark", 1.0), LabeledDocument(1L, "b d", 0.0), LabeledDocument(2L, "spark f g h", 1.0), LabeledDocument(3L, "hadoop mapreduce", 0.0))) // Configure an ML pipeline, which consists of three stages: tokenizer, hashingTF, and lr. val tokenizer = new Tokenizer() .setInputCol("text") .setOutputCol("words") val hashingTF = new HashingTF() .setNumFeatures(1000) .setInputCol(tokenizer.getOutputCol) .setOutputCol("features") val pipeline = new Pipeline().setStages(Array(tokenizer, hashingTF)) val model = pipeline.fit(training) val tranformed = model.transform(training) scala> transformed.schema res7: org.apache.spark.sql.StructType = StructType(ArrayBuffer(StructField(id,LongType,false), StructField(text,StringType,true), StructField(label,DoubleType,false), StructField(words,ArrayType(StringType,false),true), StructField(features,org.apache.spark.mllib.linalg.VectorUDT@5172cce4,true))) scala> toDataFrame(transformed) java.lang.IllegalArgumentException: Unsupported type ArrayType(StringType,false) at org.apache.spark.h2o.H2OContextUtils$.dataTypeToClass(H2OContextUtils.scala:175) at org.apache.spark.h2o.H2OContext$$anonfun$4.apply(H2OContext.scala:282) at org.apache.spark.h2o.H2OContext$$anonfun$4.apply(H2OContext.scala:282) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59) at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47) at scala.collection.TraversableLike$class.map(TraversableLike.scala:244) val transformed2 = transformed.select('features) scala> transformed2.schema res4: org.apache.spark.sql.StructType = StructType(ArrayBuffer(StructField(features,org.apache.spark.mllib.linalg.VectorUDT@5172cce4,true))) scala> toDataFrame(transformed2) java.lang.IllegalArgumentException: Unsupported type org.apache.spark.mllib.linalg.VectorUDT@5172cce4 at org.apache.spark.h2o.H2OContextUtils$.dataTypeToClass(H2OContextUtils.scala:175) at org.apache.spark.h2o.H2OContext$$anonfun$4.apply(H2OContext.scala:282) at org.apache.spark.h2o.H2OContext$$anonfun$4.apply(H2OContext.scala:282) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59) at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47) {code}
    via by Peter Rudenko,
    • java.lang.IllegalArgumentException: Unsupported type org.apache.spark.mllib.linalg.VectorUDT@5172cce4 at org.apache.spark.h2o.H2OContextUtils$.dataTypeToClass(H2OContextUtils.scala:175) at org.apache.spark.h2o.H2OContext$$anonfun$4.apply(H2OContext.scala:282) at org.apache.spark.h2o.H2OContext$$anonfun$4.apply(H2OContext.scala:282) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59) at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
    No Bugmate found.