How to print hive column name without db name in CLI


#1

Dear Team,

Will you be able to share procedure to print hive column without db name.

hive (rajkumar)> set hive.cli.print.header=true;

hive (rajkumar)> select * from avaiation_new limit 5;
OK
avaiation_new.year avaiation_new.month avaiation_new.flight_num avaiation_new.origin avaiation_new.dest avaiation_new.cancelled avaiation
_new.cancel_code avaiation_new.diversion
2008 1 335 IAD TPA 0 N 0
2008 1 3231 IAD TPA 0 N 0
2008 1 448 IND BWI 0 N 0
2008 1 3920 IND BWI 0 N 0
2008 1 378 IND JAX 0 N 0
Time taken: 0.601 seconds, Fetched: 5 row(s)

Thanks in advance.
Raj.


#2

use set hive.cli.print.current.db=false;
You can view all the hive properties and set them at session level using “set” cmd.
It also shows the suggestions.
just type set hive.(Enter tab once/twice to get suggestions)

Then you use set hive.cli.print.header=true;

Hope it is useful.:slight_smile::):blush: