Hi,
I am trying to convert a spark DataFrame to a H2OFrame,
I am getting the following exception. Shouldn't I be able to do an implicit conversion? How can I convert it to a H2OFrame?
Thanks.
scala> val bigDataFrame: H2OFrame = df
<console>:24: error: type mismatch;
found : org.apache.spark.sql.DataFrame
required: org.apache.spark.h2o.H2OFrame
(which expands to) water.fvec.H2OFrame
val bigDataFrame: H2OFrame = df
^
Hi,
I am trying to convert a spark DataFrame to a H2OFrame,
I am getting the following exception. Shouldn't I be able to do an implicit conversion? How can I convert it to a H2OFrame?
val bigDataFrame: H2OFrame = df`
you have to do: `import h2oContext._`val bigDataFrame: H2OFrame =
h2oContext.asH2OFrame(df)`
Thanks.
scala> val bigDataFrame: H2OFrame = df
<console>:24: error: type mismatch;
found : org.apache.spark.sql.DataFrame
required: org.apache.spark.h2o.H2OFrame
(which expands to) water.fvec.H2OFrame
val bigDataFrame: H2OFrame = df
^
--
You received this message because you are subscribed to the Google Groups "H2O Open Source Scalable Machine Learning - h2ostream" group.
To unsubscribe from this group and stop receiving emails from it, send an email to h2ostream+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
java.lang.IllegalArgumentException: Unsupported type DecimalType(26,2)
at org.apache.spark.h2o.H2OSchemaUtils$.dataTypeToVecType(H2OSchemaUtils.scala:119)
at org.apache.spark.h2o.H2OContext$$anonfun$5.apply(H2OContext.scala:297)
at org.apache.spark.h2o.H2OContext$$anonfun$5.apply(H2OContext.scala:295)
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.immutable.Range.foreach(Range.scala:141)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
at scala.collection.AbstractTraversable.map(Traversable.scala:105)
at org.apache.spark.h2o.H2OContext$.toH2OFrame(H2OContext.scala:295)
at org.apache.spark.h2o.H2OContext.asH2OFrame(H2OContext.scala:51)
def dataTypeToVecType(dt : DataType) : Byte = dt match { | |
case BinaryType => Vec.T_NUM | |
case ByteType => Vec.T_NUM | |
case ShortType => Vec.T_NUM | |
case IntegerType => Vec.T_NUM | |
case LongType => Vec.T_NUM | |
case FloatType => Vec.T_NUM | |
case DoubleType => Vec.T_NUM | |
case BooleanType => Vec.T_NUM | |
case TimestampType => Vec.T_TIME | |
case StringType => Vec.T_STR | |
//case StructType => dt. | |
case _ => throw new IllegalArgumentException(s"Unsupported type $dt") | |
} |