Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to export table column heaers on HDFS

Highlighted

How to export table column heaers on HDFS

New Contributor

Hi everybody,

I'm trying to export table on HDFS via Ambari but the .csv file exported has only the table content WITHOUT the column headers: if I export the same table via Ambari on my PC, the .csv file CONTAINS the column headers.

Does anybody knows how to export the column headers also when I export the table on HDFS?

Thanks for the cooperation,

Ciao,

Ennio

2 REPLIES 2

Re: How to export table column heaers on HDFS

Expert Contributor

Hi @Ennio Sisalli,

Before running your query that save the result in HDFS, can you try to set the following parameter:

set hive.cli.print.header=true;

Best regards,
Michel

Re: How to export table column heaers on HDFS

New Contributor

Hi Michel,

I've verified that in the hive configuration from the Ambari web view (in detail in the advanced configuration - advanced hive site) the hive.cli.print.header is set at true, but the problem is still the same.

I've tried also to restart the services, but we always face the issue.

Let me explain better the steps I execute to face the problem:

- Login to Ambari

- open Hive Web View 2.0

- execute a query

- select "Save to HDFS"

- set the name of the csv --> the csv has NOT the column headers.

I' ve also tried to execute the command you shared in the Hive Web View 2.0 view before the query, but the result is still the same.

Can you help me?

Thanks for your time,

Ennio.