You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@sqoop.apache.org by Scott Gallavan <sg...@gmail.com> on 2015/12/04 20:03:15 UTC

Export to mysql and add a column

I wanted to export a dataset from hive -> mysql

But I need to add a string column that is required in mysql but not present
in hive.
I know the string and it is constant for the entire export.

Is there an elegant way to do this in hive without adding a new column? or
a new table to hive?

What would be the best way to do that?Can I write a custom select statement
for the hive insert?

I was hoping that this

--columns col1,col2,col3,$customValue

would work, but that is not working for me.



Thanks


Scott

RE: Export to mysql and add a column

Posted by Link Qian <fa...@outlook.com>.
Scott,

currently Sqoop does not support this feature. a realism solution is create a new hive table and then insert data with original columns and calculating columns. finally export the hive table data to mysql.

Thanks,
Link Qian 

Date: Fri, 4 Dec 2015 11:03:15 -0800
Subject: Export to mysql and add a column
From: sgallavan@gmail.com
To: user@sqoop.apache.org

I wanted to export a dataset from hive -> mysql
But I need to add a string column that is required in mysql but not present in hive.I know the string and it is constant for the entire export.
Is there an elegant way to do this in hive without adding a new column? or a new table to hive?
What would be the best way to do that?Can I write a custom select statement for the hive insert?

I was hoping that this

--columns col1,col2,col3,$customValue

would work, but that is not working for me.



Thanks


Scott