You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Liang-Chi Hsieh (JIRA)" <ji...@apache.org> on 2015/05/19 11:13:00 UTC
[jira] [Comment Edited] (SPARK-7701) UDT not working
[ https://issues.apache.org/jira/browse/SPARK-7701?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14550087#comment-14550087 ]
Liang-Chi Hsieh edited comment on SPARK-7701 at 5/19/15 9:12 AM:
-----------------------------------------------------------------
You should wrap ExamplePoint in Products (i.e., case classes or tuples). Then your problem should be solved.
was (Author: viirya):
You should wrap ExamplePoint in Products (i.e., case classes or tuples).
> UDT not working
> ---------------
>
> Key: SPARK-7701
> URL: https://issues.apache.org/jira/browse/SPARK-7701
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 1.3.0, 1.3.1
> Reporter: bogdan baraila
>
> Using a UserDefinedType fails with the next exception:
> {code}
> ExamplePointUDT cannot be cast to org.apache.spark.sql.types.StructType
> java.lang.ClassCastException:
> ExamplePointUDT cannot be cast to org.apache.spark.sql.types.StructType
> at org.apache.spark.sql.SQLContext.createDataFrame(SQLContext.scala:316)
> {code}
> I'm using a basic example with the ExamplePointUdt from spark framework:
> {code}
> test("udt serialisation") {
> val points = Seq(new ExamplePoint(1.3, 1.6), new ExamplePoint(1.3, 1.8))
> val df = SparkContextForStdout.context.parallelize(points).toDF()
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org