Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to import multi tables from a database to Hive in one Component?

In my database, there are 100+ tables, I want to export all of them to Hive, Is there a simple way to do this? I really don't want to create 100+ "import/export flow" to do this.

Thanks.

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Honestly, I would use Sqoop: you can query the database to list the tables, then iterate over that into a Sqoop "select * from <table>" query. I've done something similar to execute the same query on several hundred databases that shared a common schema. Write the Sqoop job as a separate job, then run it from a parent job as:

 

tMSSQLInput > tFlowToIterate > tRunjob

 

tMSSQLInput gets you the list of table names. tFlowToIterate can be used to populate a context variable with the current table name; you'll pass that variable to the Sqoop job using tRunjob. Keeping the jobs separate makes it easier to handle database connectivity/timeout issues, since it isolates each table load so that a single failure doesn't kill the entire job (you'll need to set up tRunjob to not die on error for this to work).

 

Hope this helps,

 

David

View solution in original post

1 Reply
Anonymous
Not applicable
Author

Honestly, I would use Sqoop: you can query the database to list the tables, then iterate over that into a Sqoop "select * from <table>" query. I've done something similar to execute the same query on several hundred databases that shared a common schema. Write the Sqoop job as a separate job, then run it from a parent job as:

 

tMSSQLInput > tFlowToIterate > tRunjob

 

tMSSQLInput gets you the list of table names. tFlowToIterate can be used to populate a context variable with the current table name; you'll pass that variable to the Sqoop job using tRunjob. Keeping the jobs separate makes it easier to handle database connectivity/timeout issues, since it isolates each table load so that a single failure doesn't kill the entire job (you'll need to set up tRunjob to not die on error for this to work).

 

Hope this helps,

 

David