Connected Database in Apache Hive & Impala

Since Impala-shell does not show the database in which we are working or the database to which we are connected, there is a risk of uncertainty and this could lead to the table being dropped from the wrong database. It is indeed advisable to verify the connected database before performing any DDL operation.

CURRENT_DATABASE() is the function that returns the database that the session is currently using, either default if no database has been selected, or whatever database the session switched to through a USE statement or the impalad -d option.

Usage:
SELECT CURRENT_DATABASE();



4 comments

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s