Two Very Useful Hive CLI settings

It is very helpful to set these in your .hiverc file. The hive cli reads from the .hiverc file in your home directory to override defaults.

Two of the settings I find very important is

set hive.cli.print.header=true;
set hive.cli.print.current.db=true;

The first line prints column headers when you do a select * from table. The second line prints the current database in the prompt. Both very very helpful features which I think should be turned on by default. Oh well.

Beware any changes in your .hiverc file will also affect the output of hive -e and hive -f commands. So if you have scripts that dump hive tables using any of the above methods the headers will be printed in the output.


Now read this

Create Views over JSON Data in Hive

The beauty of storing raw JSON in HIVE is that you can potentially create multiple tables on the same data using Hive Views. Hive allows you to query JSON data using couple of different ways (json_tuple and get_json_object). The... Continue →