Re: how to merge two dataframes

2015-10-30 Thread Silvio Fiorito
iy...@gmail.com>> Date: Friday, October 30, 2015 at 3:57 PM To: Ted Yu mailto:yuzhih...@gmail.com>> Cc: "user@spark.apache.org<mailto:user@spark.apache.org>" mailto:user@spark.apache.org>> Subject: Re: how to merge two dataframes Not a bad idea I suspect but doesn

Re: how to merge two dataframes

2015-10-30 Thread Ted Yu
I see - you were trying to union a non-Cassandra DF with Cassandra DF :-( On Fri, Oct 30, 2015 at 12:57 PM, Yana Kadiyska wrote: > Not a bad idea I suspect but doesn't help me. I dumbed down the repro to > ask for help. In reality one of my dataframes is a cassandra DF. > So cassDF.registerTempT

Re: how to merge two dataframes

2015-10-30 Thread Yana Kadiyska
Not a bad idea I suspect but doesn't help me. I dumbed down the repro to ask for help. In reality one of my dataframes is a cassandra DF. So cassDF.registerTempTable("df1") registers the temp table in a different SQL Context (new CassandraSQLContext(sc)). scala> sql("select customer_id, uri, brow

Re: how to merge two dataframes

2015-10-30 Thread Ted Yu
How about the following ? scala> df.registerTempTable("df") scala> df1.registerTempTable("df1") scala> sql("select customer_id, uri, browser, epoch from df union select customer_id, uri, browser, epoch from df1").show() +---+-+---+-+ |customer_id| uri|browser|e

Re: How to merge two dataframes with same schema

2015-04-22 Thread Peter Rudenko
Just use unionAll method: df1.show() nameid a 1 b 2 df2.show() nameid c 3 d 4 df1.unionAll(df2).show() nameid a 1 b 2 c 3 d 4 Thanks, Peter Rudneko On 2015-04-22 16:38, bipin wrote: I have looked into