We are hoping to add better support for UDTs in the next release, but for now you can use kryo to generate an encoder for any class:
implicit val vectorEncoder = org.apache.spark.sql.Encoders.kryo[SparseVector] On Thu, Feb 4, 2016 at 12:22 PM, raj.kumar <raj.ku...@hooklogic.com> wrote: > Hi, > > I have a DataFrame df with a column "feature" of type SparseVector that > results from the ml library's VectorAssembler class. > > I'd like to get a Dataset of SparseVectors from this column, but when I do > a > > df.as[SparseVector] scala complains that it doesn't know of an encoder for > SparseVector. If I then try to implement the Encoder[T] interface for > SparseVector I get the error > "java.lang.RuntimeException: Only expression encoders are supported today" > > How can I get a Dataset[SparseVector] from the output of VectorAssembler? > > > > -- > View this message in context: > http://apache-spark-user-list.1001560.n3.nabble.com/Dataset-Encoders-for-SparseVector-tp26149.html > Sent from the Apache Spark User List mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@spark.apache.org > For additional commands, e-mail: user-h...@spark.apache.org > >