I tried SaveMode.Append and SaveMode.Overwrite , the output table was modified 
. 
Is the _c0 and _c1 automatically generated for the DataFrame Schema? 
In my scenario , i hope it just flush the data from DataFrame to RMDB if there 
are the same structure between on both . but i found the column name was 
modified.

 
From: Josh Rosen
Date: 2015-09-17 11:42
To: guoqing0...@yahoo.com.hk
CC: Ted Yu; user
Subject: Re: Re: Table is modified by DataFrameWriter
What are your JDBC properties configured to? Do you have overwrite mode enabled?

On Wed, Sep 16, 2015 at 7:39 PM, guoqing0...@yahoo.com.hk 
<guoqing0...@yahoo.com.hk> wrote:
Spark-1.4.1

 
From: Ted Yu
Date: 2015-09-17 10:29
To: guoqing0...@yahoo.com.hk
CC: user
Subject: Re: Table is modified by DataFrameWriter
Can you tell us which release you were using ?

Thanks



On Sep 16, 2015, at 7:11 PM, "guoqing0...@yahoo.com.hk" 
<guoqing0...@yahoo.com.hk> wrote:

Hi all,
I found the table structure was modified  when use DataFrameWriter.jdbc to save 
the content of DataFrame , 
 
sqlContext.sql("select '2015-09-17',count(1) from 
test").write.jdbc(url,test,properties)

table structure before saving:
app_key text
t_amount bigint(20)

saved:
_c0 text
_c1 bigint(20)

Is there any way to just save the field in sequence and do not alter the table 
? 

Thanks!

Reply via email to