Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 05-16-2017 01:58 AM
Hi everyone, I'm getting data from MySQL and a couple of csv from HDFS to my Hive and HBase services in hadoop. When i perform the script based in the information coming from the official sqoop tool https://sqoop.apache.org/docs/1.4.1-incubating/SqoopUserGuide.html i can't see anything about a parameter to specify the name of a DB in Hive or Hbase to complete the import, all my imports are in default db but i need to specify the name of DB.
Thanks so much for your help guys.
AU
Created 05-16-2017 02:06 AM
Take a look at the below link for the different ways to Sqoop data into Hive.
And below for HBase.
http://www.dummies.com/programming/big-data/hadoop/importing-data-into-hbase-with-sqoop/
Created 05-16-2017 02:06 AM
Take a look at the below link for the different ways to Sqoop data into Hive.
And below for HBase.
http://www.dummies.com/programming/big-data/hadoop/importing-data-into-hbase-with-sqoop/
Created 05-16-2017 02:12 AM
Hi buddy thanks for answer. I went there before came here lol but i couldnt find the answer. thanks
Created 05-16-2017 02:15 AM
In the table at the bottom of the page for the first link:
--hive-table <table_name> | Specifies the table name to use when importing data into Hive. |
So your command would look like
sqoop import --connect jdbc:mysql://db.foo.com/corp --table EMPLOYEES --hive-import --hive-table MYTABLE
Created 05-16-2017 06:44 PM
Oh yeah buddy by i want to specify the DB in hive for the destination i mean something like --hive-database you get me , cause as default all impoted tables in Hive go to default DB . My requirement is set a different DB to put the data. thanks
Created 05-16-2017 07:05 PM
I see. I misread your question. This request was addressed in the below jira:
https://issues.apache.org/jira/browse/SQOOP-912
The flag to specify the database is "--hive-database".
Your command would look like
sqoop import --connect jdbc:mysql://db.foo.com/corp --table EMPLOYEES --hive-import --hive-database MYDATABASE OR sqoop import --connect jdbc:mysql://db.foo.com/corp --table EMPLOYEES --hive-import --hive-table MYDATABASE.MYTABLE
Created 05-17-2017 07:15 PM
Great @Eyad Garelnabi thanks so much that was what I was looking for!!! i will close the question i appreciate.