You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by Sree Eedupuganti <sr...@inndata.in> on 2016/08/18 07:56:52 UTC

Converting Dataframe to resultSet in Spark Java

Retrieved the data to DataFrame but i can't convert into ResultSet.... Is
there any possible way how to convert...Any suggestions please...

Exception in thread "main" java.lang.ClassCastException:
org.apache.spark.sql.DataFrame cannot be cast to
com.datastax.driver.core.ResultSet
-- 
Best Regards,
Sreeharsha Eedupuganti
Data Engineer
innData Analytics Private Limited

Re: Converting Dataframe to resultSet in Spark Java

Posted by rakesh sharma <ra...@hotmail.com>.
Hi Sree


I dont think what you are trying to do is correct. DataFrame and ResultSet are two different types. And no strongly typed language will alow you to do that.

If your intention is to traverse the DataFrame or get the individual rows and columns then you must try the map function and pass anonymous function definitions with the required logic.


thanks

rakesh

________________________________
From: Sree Eedupuganti <sr...@inndata.in>
Sent: Thursday, August 18, 2016 1:26:52 PM
To: user
Subject: Converting Dataframe to resultSet in Spark Java


Retrieved the data to DataFrame but i can't convert into ResultSet.... Is there any possible way how to convert...Any suggestions please...

Exception in thread "main" java.lang.ClassCastException: org.apache.spark.sql.DataFrame cannot be cast to com.datastax.driver.core.ResultSet

--
Best Regards,
Sreeharsha Eedupuganti
Data Engineer
innData Analytics Private Limited