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 06-04-2018 12:40 PM
Hi all,
I want to import specific tables from MsSQL to HIVE database. Although I have tried --exclude-tables arguments for excluding some table while importing.
But my scenario is a little bit different.
For Example, If I have 100 tables and I want to import only 98 tables then I could exclude those 2 tables using --exclude-tables argument. But what if I want to import only 2 tables among those 100 tables.
I tried to give multiple tables names in --table argument.
My observation:
import-all-tables --connect jdbc:sqlserver://<HOST>:<port>;databasename=<mssql_database_name> --username xxxxx --password xxxx --table mssql_table1,mssql_table2 --hive-import --hive-database <hive_database_name> --fields-terminated-by "," -m 1
Does anyone have an idea?
Regards,
Jay.
Created 06-04-2018 01:04 PM
One way of doing is using --exclude-tables argument and mentioning all the tables with comma separated values.
(or)
Writing shell script to to have the required two tables and iterating sqoop job on these tables.
Created 06-04-2018 02:06 PM
If that is the case you might need to script it in advance see using Sqoop to fetch many tables in parallel
Hope that helps
Created 06-22-2018 01:01 PM
Created 06-22-2018 01:13 PM
Please have a look into my sqoop code.
sqoop import --connect jdbc:sqlserver://<HOST>:<PORT>;databasename=<mssql_database_nameMS> --username xxxx --password xxxx --hive-database <hive_database_name> --table <mssql_table1>,<mssql_table2> --hive-import -m 1
Thank you,
Jay.