How to view active database in hive terminal? - hive

Is there is any way to see in which database we are working with in hive terminal. while working in hive using webGUI(hue) there is a list of database from where we can select the database(which will be active database)

Yes, we can. for that we have to set the properties in hive terminal.
SET hive.cli.print.current.db = true;

Related

Is it possible that Hive table as source and Oracle table as target in Informatica developer tool with hive environment?

I want to use HIVE table as a source and Oracle table as target in my Informatica developer tool mapping with hive environment. Mean I want to run my Informatcia developer tool mapping in HIVE mode. Is it possible if yes then please let me know the steps.
Thanks
Yes, it is possible, You just need to change the execution engine.
Refer to Informatica BDM help document for the detailed steps
You can create Oracle connection via sqoop and use it with any of the Hadoop engine in informatica bdm
Yes this is possible using sqoop for oracle. But there is limitation that with sqoop you can only insert in oracle.
You can use PowerExchange for Hadoop to load data from PowerCenter to new Hive tables.
Source or targets will appear in PowerCenter as ODBC data sources or ODBC targets .

Hive tables not shown in /user/hive/warehouse

I have created 2 DBs:
DB1 'Airline',
DB2 'Students'.
I can see DB1 in Hue browser. But cannot see its tables inside /user/hive/warehouse/Airline.db/.
I can see tables of Students.db in /user/hive/warehouse/Students.db. But cannot see it in hue browser.
Is there anything I need to set?
Do you have an acces to Hive CLI? If yes, try run command:
describe database Airline;
You should see something like that:
Airline Airline Hive database hdfs://<host-fqdn>:8020/apps/hive/warehouse public
This is how you can find location of database. You can run the same command for 'Student' database.

HIVE create table is hanging - CDH 5.7

Create table script in HIVE is hanging and it is not completing for long time. I am using CDH 5.7, 'show databases' takes time to retrieve the data and finally it showed list of all databases. Below create script i am using:
create table dept
( dep_id int,
dep_name string
);
Am I missing some configuration settings with related to HIVE? Also I am able to see green image in Cloudera Manager(CM) for HIVE.
Looks like Hive metastore was hanging, after restarting Hive service it started working. Thanks for your help in Cloduera community

Impala Cannot access Hive Database

I have created a database using hql , and is being created there . But I am not able to use that database from an impala application . But the table exists in the hive and we ca query it there . This issue is seen only for some newly created tables. Can somebody please help
issue the following command in impala shell.
invalidate metadata;
This will load the metadata information to the impala coordinator node you are connected to.
http://www.cloudera.com/documentation/archive/impala/2-x/2-1-x/topics/impala_invalidate_metadata.html

choosing where to save sqlite database

This is probably a simple question, but I could use some help. I am trying to build a small database for an application that will only be run on my computer so I want to create a local database.
To do this I am trying to use sqlite. I can use the command prompt to make what seems to be a database by using the sqlite3 databaseName; functionality, but I do not know where it is being stored.
I need to be able to find the database to access it through the application I am experimenting with. I already know all of the basic sql and such for creating the database tables and data, but I cannot figure out how to simply make the database connection.
is there a way to specify where the database .db file will be stored, and why can I not find the file it seems to be making?
Using sqlite3 shell? Some help using sqlite3 -help:
Usage: sqlite3 [OPTIONS] FILENAME [SQL]
If FILENAME is not supplied, shell uses an temporary database.
If you start shell without supplying a filename, you may save temporary database at any time using:
sqlite> .backup MAIN "folder\your_file.extension"
Or you can ATTACH an existing database an use SQL methods:
sqlite> ATTACH DATABASE "path\stored.db" AS other;
sqlite> INSERT OR REPLACE INTO other.table1 SELECT * FROM this_table1;
sqlite> DETACH other;
For doing such things , you can use Sqlite Manager , you'll get it as a Firefox addon. It's excellent in creating / Managing Sqlite database.
https://addons.mozilla.org/en-US/firefox/addon/sqlite-manager/
Thanks everyone for answering, but it turns out my issue was much simpler than I thought.
I was trying to name the database after already starting the shell.
I was supposed to create the database from command line by doing sqlite3 name.db
But I was trying to use that command within the sqlite shell so nothing was being created.