Reputation: 197
I need to import data from RDBMS table into remote Hive machine. How can i achieve this using Sqoop ?
In nut shell, How to specify hive database name and the hive machine i/p in the import command?
Please help me with appropriate sqoop command.
Upvotes: 0
Views: 595
Reputation: 41428
You should run the sqoop
command on the machine where you have Hive installed, because sqoop
will look for $HIVE_HOME/bin/hive
to execute the CREATE TABLE ...
and other statements.
Alternatively, you could use sqoop
with the --hive-home
command line option to specify where your Hive is installed (just overrides $HIVE_HOME
)
To connect to your remote RDBMS:
sqoop import --connect jdbc:mysql://remote-server/mytable --username xxx --password yyy
To import into Hive:
sqoop import --hive-import
You can get a more comprehensive list of commands by looking at http://archive.cloudera.com/cdh/3/sqoop/SqoopUserGuide.html#_literal_sqoop_import_literal">this link.
Upvotes: 1