spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diwakar Dhanuskodi <diwakar.dhanusk...@gmail.com>
Subject RE: Fwd: DF creation
Date Sat, 19 Mar 2016 05:26:25 GMT
Import sqlContext.implicits._  before  using  df ()


Sent from Samsung Mobile.

<div>-------- Original message --------</div><div>From: satyajit vegesna
<satyajit.apasprk@gmail.com> </div><div>Date:19/03/2016  06:00  (GMT+05:30)
</div><div>To: user@spark.apache.org, dev@spark.apache.org </div><div>Cc:
 </div><div>Subject: Fwd: DF creation </div><div>
</div>
Hi ,

I am trying to create separate val reference to object DATA (as shown below),  

case class data(name:String,age:String)

Creation of this object is done separately and the reference to the object is stored into
val data.

i use val samplerdd = sc.parallelize(Seq(data)) , to create RDD.
org.apache.spark.rdd.RDD[data] = ParallelCollectionRDD[10] at parallelize at <console>:24

is there a way to create dataframe out of this, without using  createDataFrame, and by using
toDF() which i was unable to convert.(would like to avoid providing the structtype).

Regards,
Satyajit.



Mime
View raw message