Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
PhilHibbs
Creator II
Creator II

Running a chain of Hive statements in different databases

I need to execute a series of Hive statements in Talend.

Firstly, I need to issue a "use my_db_name" command, so that the next command defaults to that database.

Then I need to issue "show tables", and capture the list of tables.

 

The problem is, the "use my_db_name" command doesn't change the current database. It stays in the database that the connection specifies. The user has access to other databases, so there's no permissions problem.

Any ideas how I can run Hive commands like "use my_db_name" and "show tables" through Talend?

Labels (2)
1 Solution

Accepted Solutions
PhilHibbs
Creator II
Creator II
Author

Answering my own question:

Create a connection with an empty database name (""). Then, the "use my_database_name" command will switch database, and subsequent commands will operate in that database.

View solution in original post

1 Reply
PhilHibbs
Creator II
Creator II
Author

Answering my own question:

Create a connection with an empty database name (""). Then, the "use my_database_name" command will switch database, and subsequent commands will operate in that database.