perform RDD operations on DataFrames - Stack Overflow
stackoverflow.com › questions › 41137198Dec 14, 2016 · I need to perform RDD operations on these DataFrame. Is it possible to perform RDD operations like map, flatMap, etc.. here is my sample code: df.select("COUNTY","VEHICLES").show(); this is my dataframe and i need to convert this dataframe to RDD and operate some RDD operations on this new RDD. Here is code how i am converted dataframe to RDD. RDD<Row> java = df.select("COUNTY","VEHICLES").rdd();
scala - How to convert rdd object to dataframe in spark ...
stackoverflow.com › questions › 29383578Apr 1, 2015 · Example for converting an RDD of an old DataFrame: val rdd = oldDF.rdd val newDF = oldDF.sqlContext.createDataFrame(rdd, oldDF.schema) Note that there is no need to explicitly set any schema column. We reuse the old DF's schema, which is of StructType class and can be easily extended. However, this approach sometimes is not possible, and in some cases can be less efficient than the first one.
perform RDD operations on DataFrames - Stack Overflow
https://stackoverflow.com/questions/41137198I need to perform RDD operations on these DataFrame. Is it possible to perform RDD operations like map, flatMap, etc.. here is my sample code: df.select("COUNTY","VEHICLES").show(); this is my dataframe and i need to convert this dataframe to RDD and operate some RDD operations on this new RDD. Here is code how i am converted dataframe to RDD. RDD<Row> java = df.select("COUNTY","VEHICLES").rdd();