Hive: writing column headers to local file?

CMaury picture CMaury · Apr 14, 2011 · Viewed 69.4k times · Source

Hive documentation lacking again:

I'd like to write the results of a query to a local file as well as the names of the columns.

Does Hive support this?

Insert overwrite local directory 'tmp/blah.blah' select * from table_name;

Also, separate question: Is StackOverflow the best place to get Hive Help? @Nija, has been very helpful, but I don't to keep bothering them...

Answer

iggy picture iggy · Nov 26, 2011

Try

set hive.cli.print.header=true;