You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by asethia <se...@gmail.com> on 2016/04/03 19:57:35 UTC
GenericRowWithSchema to case class
Hi,
My Cassandra table has custom user defined say example:
CREATE TYPE address (
addressline1 text,
addressline2 text,
city text,
state text,
country text,
pincode text
)
create table person (
id text,
name text,
addresses set<frozen<address>>,
PRIMARY KEY (id));
val rdd=sqlContext.read.format("org.apache.spark.sql.cassandra")
.options(Map("keyspace" ->"test", "table" -> "test")).load()
rdd.collect()
I would like to collect as case objects; which I am able to for person id
and name using row.getAs, but for addresses it is showing WrappleArray, and
each array element is
CompactBuffer(org.apache.spark.sql.catalyst.expressions.GenericRowWithSchema).
Is there any way I can get addresses mapped to Address case class?
Thanks,
Arun
--
View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/GenericRowWithSchema-to-case-class-tp26666.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
For additional commands, e-mail: user-help@spark.apache.org