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_krish...@mindtree.com]
Sent: Tuesday, October 23, 2012 11:27 AM
To: 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.

Reply via email to