Saturday, December 27, 2014

Very Useful Hive CLI settings

hive.cli.print.current.db [Show the current database as part of the prompt]


The USE command sets a database as your working database, analogous to changing working directories in a filesystem:
hive> USE workshop;

There is no command to show you which database is your current working database.


To show the current database as part of the prompt, set the property 'hive.cli.print.current.db' to show the current database as part of the prompt:

hive> set hive.cli.print.current.db=true;
hive (workshop)> USE default;
hive (default)> set hive.cli.print.current.db=false;
hive> 

hive.cli.print.header [Print table columns header]

CLI to print column headers, which is disabled by default. We can enable this feature by setting

hive> set hive.cli.print.header=true;
hive> SELECT * FROM employee LIMIT 2;
employee.id employee.name employee.age
101 Satish 30
102 kumar 29





No comments:

Post a Comment