- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
*Closed* : How to import mutilple tables (not all tables) in Sqoop
- Labels:
-
Apache Hive
-
Apache Sqoop
Created ‎06-04-2018 12:40 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Created ‎06-22-2018 01:13 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.

- « Previous
-
- 1
- 2
- Next »