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&lt;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-unsubscr...@spark.apache.org
For additional commands, e-mail: user-h...@spark.apache.org

Reply via email to