hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Venugopal Krishnan <Venugopal_Krish...@mindtree.com>
Subject RE: Query
Date Tue, 23 Oct 2012 06:24:43 GMT
Hi Savant,

Thanks for your reply . we are trying this option also but we are using the below query from
the hive client which generates a text file on the cluster. Is it not possible to generate
the column headers in the text file ?  with the default query without using metadata of resultset.

insert overwrite directory '/user/hdev/temp'  select * from customer .

Regards,
Venu

From: Savant, Keshav [mailto:Keshav.C.Savant@fisglobal.com]
Sent: Tuesday, October 23, 2012 11:43 AM
To: user@hive.apache.org; Venugopal Krishnan
Subject: RE: Query

Hi Krishnan,

To do this dynamically for any query....

Check if hive JDBC driver supports/provides the metadata for the result set, if yes then u
can get the metadata of resultset, get its column count, and then you can get column names,
types etc.

http://javasourcecode.org/html/open-source/hive/hive-0.7.1/org/apache/hadoop/hive/jdbc/HiveResultSetMetaData.html

Kind regards,
Keshav
rom: Venugopal Krishnan [mailto:Venugopal_Krishnan@mindtree.com]<mailto:[mailto:Venugopal_Krishnan@mindtree.com]>
Sent: Tuesday, October 23, 2012 11:27 AM
To: user@hive.apache.org<mailto:user@hive.apache.org>
Subject: Query

Hi,

We have a requirement where we need to print the column headers in the generated file on executing
a query. We are using Jdbc hive client to execute the query.

Regards,
Venugopal


________________________________

http://www.mindtree.com/email/disclaimer.html
_____________
The information contained in this message is proprietary and/or confidential. If you are not
the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose,
distribute or use the message in any manner; and (iii) notify the sender immediately. In addition,
please be aware that any message addressed to our domain is subject to archiving and review
by persons other than the intended recipient. Thank you.

Mime
View raw message