Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

hive.cli.print.header=true not working

Tags:

hive

I'm trying to export the results of a query to the file system. Everything works fine, except that I can't get the column headers as part of the file. Here's what my script looks like:

set hive.cli.print.header=true;
set mapreduce.task.timeout=0;
set hive.auto.convert.join=false;
set hive.execution.engine=tez;

insert overwrite local directory '/work/output'
ROW FORMAT DELIMTED
FIELDS TERMINATED BY '|'

select...

Am I missing something?

like image 316
Andrew Avatar asked Dec 29 '25 05:12

Andrew


1 Answers

if you use hive cli the below command should give you the file with column name as header.

hive -S -e "set hive.cli.print.header=true;select * from a1;" >out101.text
like image 165
Abraham Avatar answered Dec 30 '25 23:12

Abraham



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!